|
|
View previous topic :: View next topic |
Author |
Message |
raptorman
Joined: 08 Mar 2008 Posts: 12
|
Questions on implementing TDMA |
Posted: Sat Aug 10, 2013 2:24 pm |
|
|
I'm trying to implement some sensors on SBUS2 for my RC hobby. I program for a living but only in iOS and Visual Studio. I dont expect any code, just some suggestions on implementing the design. I'm using a 18lf14k22 and CCS compiler 5.011. I'm also including an image that shows the overall data stream.
I have a 100k Serial Stream with 4 sections of main data consisting of 25 bytes each with a ending byte that identifies which main section of data. In between each main section, you have 8 slots of sensor data consisting of 3 bytes for each slot. I'm creating my own sensors and putting the data into 1 of 32 unused slots. I'm receiving the main and slot data thru the uart.
So the question on design is how to sync up with the main data so I know where I'm at. This is what I was thinking:
Sync up with the data:
Wait for the serial to go high using an interrupt-on change.
Start timer.
wait for it to go low using an interrupt-on change.
if timer less than 5ms(time from last slot to main data), repeat the above.
If timer over 5ms its should be starting the next main section of data.
I have the last main section of data, its ending byte from the uart.
Look at the previous ending byte and I know where I'm at.
Once the program knows where it at, I can calculate when to put data out into the slots. That brings up the next design phase of precise timing the output of the data using the uart or bit-banging.
Anybody else have a better solution?
Thanks,
Jerry
Couldnt get image to display so click URL:
http://rc.runryder.com/helicopter/rr/rrpv.htm?d=/helicopter/gallery/32504/&IN=1&TZ=-7&a=0&s=0 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Aug 11, 2013 6:21 pm |
|
|
I didn't 'google ' too long but...
There seems to be a lot of 'activity' with Ardunios and SBUS2, so you
could port their C code into CCS C code.
You've probably already hit the net..but providing you've got working hardware, the code conversion should be fairly straightforward, and can be easily tested on the bench.
hth
jay |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|