Serial Peripheral Interface

More
27 Dec 2016 02:21 #84729 by monkey_biz
monkey_biz created the topic: Serial Peripheral Interface
Hi everyone! This is my first post here. I am a 4th year electrical engineering student. I am part of a project of which we're using a beagle bone to output signals to an FPGA. The way we're doing this is through the use of SPI. To do this would I have to change a source code file or could I do this via writing my own script to retrieve these values in real time? (With the right program java can read/write 135 MB/s so speed isn't an issue for real time). This project is the first I've heard of LinuxCNC so any help would be greatly appreciated thanks!
More
27 Dec 2016 03:28 #84731 by andypugh
andypugh replied the topic: Serial Peripheral Interface
Can you explain where LinuxCNC fits into this system?

I rather think that you are confusing data-rate with latency. LinuxCNC typically transmits very little data (dozens of bytes) but it does it every 1mS +/- 25uS.

I am certain that we can help you with your project (I did 15 years postdoctoral research, so have pedagogic inclinations) but I question your underlying architecture.
More
30 Dec 2016 20:53 #84930 by monkey_biz
monkey_biz replied the topic: Serial Peripheral Interface
Yes, I understand that it will only output dozens of bits but I somehow need to write the SPI script. the LinuxCNC software is going onto a beagle bone black and I need to send the data packets via SPI to my FPGA through the outputs on the beagle.

I have been reading quite a bit about LinuxCNC and understand somewhat the process that happens I am just unsure where my piece of code would fit in to retrieve the outputted data packets from LinuxCNC and then send them to the FPGA.

I hope this makes a bit more sense as what I am trying to do?
More
30 Dec 2016 21:34 #84934 by andypugh
andypugh replied the topic: Serial Peripheral Interface
There is a bitbanged SPI component here:

github.com/LinuxCNC/linuxcnc/blob/master...onents/max31855.comp

Might be a starting point.
More
07 Jan 2017 21:59 #85426 by monkey_biz
monkey_biz replied the topic: Serial Peripheral Interface
Wouldn't I be able to just use the SPI hardware provided on the beagle bone for this as opposed to do a bit banged SPI? I am doing my best to get acquainted with linux but it is proving to be tough
More
17 Jan 2017 13:12 #85914 by andypugh
andypugh replied the topic: Serial Peripheral Interface

monkey_biz wrote: Wouldn't I be able to just use the SPI hardware provided on the beagle bone for this as opposed to do a bit banged SPI? I am doing my best to get acquainted with linux but it is proving to be tough


In theory, yes.
You would need a simple HAL driver to get values from HAL and put them into the BB SPI registers.

Writing HAL drivers can often be surprisingly simple. Do you have any C-code examples using BB SPI?
More
19 Jan 2017 02:23 #86120 by monkey_biz
monkey_biz replied the topic: Serial Peripheral Interface
Currently this is what I'm following. embedded-basics.blogspot.ca/2014/10/enab...eaglebone-black.html
I am using this via Debian Jessie as opposed to wheezy. Wheezy's SPI cape manager is broken and they did fix it in the 4.1 kernel. About 3 days ago a machine kit beagle bone image just came out using jessie (can be found here elinux.org/Beagleboard:BeagleBoneBlack_Debian ) which should mean that Linux users wanting Jessie should be able to finally do machine control as opposed to just simulation control. Of course you would know more about that than me so I am not 100% sure
More
19 Jan 2017 05:01 #86127 by monkey_biz
monkey_biz replied the topic: Serial Peripheral Interface
So that link for the 4.1 kernel machine kit is really only the 3.8.13 kernel.

One more question. The reason we need a real time kernel is to make sure the program LinuxCNC outputs the values on time so that the parallel ports can transmit them on time right?

I guess my question is where EXACTLY in the whole system when its running (from application to the motors) is the slowest part which needs to meet the time constraints of controlling it real time.
More
19 Jan 2017 10:38 #86137 by andypugh
andypugh replied the topic: Serial Peripheral Interface
Be aware that there is now considerable divergence between Machinekit and LinuxCNC. I you are using Machinekit then you may need to get your answers from their forums.

The realtime layer is not about speed so much as well-defined time-intervals.
G-code interpretation is non-realtime, the G-code is turned into a sequence of simple movements. These movements are converted to a set of axis positions and it is these positions that are transmitted by the realtime layer. Every 1mS a new set of positions comes out of the motion module, and also every 1mS the current hardware position and inputs are processed.

Basically, only the parts of LinuxCNC that "touch" hardware are realtime.
More
19 Jan 2017 15:09 #86152 by monkey_biz
monkey_biz replied the topic: Serial Peripheral Interface
ok so from my understanding so far

RT-Kernel is what helps define real time intervals

MachineKit is a program that just defines the HAL configurations to connect I/O's from linuxCNC?

and if G-code isn't real time how does it manage to have real time movement?

I apologize for all the questions this is pretty new to me
Time to create page: 0.151 seconds
Powered by Kunena Forum