Bit Stream Generator with Propeller
jbuehler
Posts: 3
Hello there,
I'm new to the Propeller but I'm really loving it so far. Seems like there is a lot of knowledgeable folks on this forum. I've got a project that I figured I'd bounce off you guys. I'm working on the telemetry aspect of a pulse-oximeter (that white clip-on thing, goes on your finger in the hospital) for my senior project. Right now we're in the early stages, and need to test out our clock recovery circuit.
So what's the task? Ideally, we'd like to have an input data file on the PC (at least 32 bytes of hexadecimal numbers). Next, bit-serially transmit the data at a rate we control between 10-60kbit/s out one of the Propeller pins. I'm not quite sure how to control the timing of the transmission yet... but it would be great to understand how.
At the same time, we'll be sending a clock square-wave (50% duty) and an Output Enable (OE) signal out two other pins. I've only programmed one microcontroller in C (some ancient dinosaur my college had) so I'm vaguely familiar with how those two should work. It's timing them all together that I'm having trouble wrapping my head around.
I've spent a few weeks playing around with the Propeller and learning SPIN. That all makes sense now, and I can blink LEDs with the best of them, but how about something useful. My team and I are concerned that SPIN will be too slow to meet our timing constraints and that we will need to use ASM. This is when we stumbled upon ImageCraft's C compiler. From afar, it looks promising, but then I realized I won't be able to use the Serial SPIN object anymore (not without conversion anyway). So that's yet another fork in the road.
And this is only the first task we're going to use the Propeller to do. So you can get an idea of what we'll need to do by the end, here's a quick laundry-list.
* Reed-Solomon encoding of data (doubles our bits)
* Packetize the data
* Interleave multiple packets to form new interleaved packets
* Add framing, eg. headers, idle symbols, etc
* Turn the transmitter on (OE signal)
* Transmit encoded data in serial form through single Propeller pin to the radio transmitter
* Read serial data from the radio receiver at the instant a recovered clock goes high
* Deserialize the incoming channel-encoded bit stream
* Channel-decode the received data
* As each packet is completely decoded, transmit data over USB to PC/Matlab
- Our incoming data rate from the pulse-oximeter is ~2-20kbit/s
Suggestions/Recommendations/Warnings on this bit-stream generator?? Anything would be greatly appreciated. I'm shooting in the dark here, I'd rather not step in a gigantic pothole if someone knows where it is. Is SPIN fast enough? Is C worth using if it means converting any SPIN objects I need? Does this whole thing have to be written in ASM if we want any kind of control over microsecond timings?
Thanks much!,
Jonathan
I'm new to the Propeller but I'm really loving it so far. Seems like there is a lot of knowledgeable folks on this forum. I've got a project that I figured I'd bounce off you guys. I'm working on the telemetry aspect of a pulse-oximeter (that white clip-on thing, goes on your finger in the hospital) for my senior project. Right now we're in the early stages, and need to test out our clock recovery circuit.
So what's the task? Ideally, we'd like to have an input data file on the PC (at least 32 bytes of hexadecimal numbers). Next, bit-serially transmit the data at a rate we control between 10-60kbit/s out one of the Propeller pins. I'm not quite sure how to control the timing of the transmission yet... but it would be great to understand how.
At the same time, we'll be sending a clock square-wave (50% duty) and an Output Enable (OE) signal out two other pins. I've only programmed one microcontroller in C (some ancient dinosaur my college had) so I'm vaguely familiar with how those two should work. It's timing them all together that I'm having trouble wrapping my head around.
I've spent a few weeks playing around with the Propeller and learning SPIN. That all makes sense now, and I can blink LEDs with the best of them, but how about something useful. My team and I are concerned that SPIN will be too slow to meet our timing constraints and that we will need to use ASM. This is when we stumbled upon ImageCraft's C compiler. From afar, it looks promising, but then I realized I won't be able to use the Serial SPIN object anymore (not without conversion anyway). So that's yet another fork in the road.
And this is only the first task we're going to use the Propeller to do. So you can get an idea of what we'll need to do by the end, here's a quick laundry-list.
* Reed-Solomon encoding of data (doubles our bits)
* Packetize the data
* Interleave multiple packets to form new interleaved packets
* Add framing, eg. headers, idle symbols, etc
* Turn the transmitter on (OE signal)
* Transmit encoded data in serial form through single Propeller pin to the radio transmitter
* Read serial data from the radio receiver at the instant a recovered clock goes high
* Deserialize the incoming channel-encoded bit stream
* Channel-decode the received data
* As each packet is completely decoded, transmit data over USB to PC/Matlab
- Our incoming data rate from the pulse-oximeter is ~2-20kbit/s
Suggestions/Recommendations/Warnings on this bit-stream generator?? Anything would be greatly appreciated. I'm shooting in the dark here, I'd rather not step in a gigantic pothole if someone knows where it is. Is SPIN fast enough? Is C worth using if it means converting any SPIN objects I need? Does this whole thing have to be written in ASM if we want any kind of control over microsecond timings?
Thanks much!,
Jonathan
Comments
C FullDuplexSerial
ICC version of FullDuplexSerial.spin. User must have a "..\output" directory for building this project as is. please see README.txt for more details.
Version 1.1 fixed a bug where start always ...
1.2
obex.parallax.com/objects/361/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob
Sweet! Music to my ears. I did not see that on the Object Exchange...
-Jon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Lawson
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Post Edited (Lawson) : 2/13/2009 7:52:20 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps (SixBladeProp)
· Prop Tools under Development or Completed (Index)
· Emulators (Micros eg Altair, and Terminals eg VT100) - index
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz
It looks like the C compiler won't be very useful for our application. From what I have read, using it requires losing the ability to use SPIN on the same chip/kit (the SPIN interpreter is overwritten). We have other teams who will be wanting to run small SPIN code in one of the 8 cogs... and they would not take kindly to being told they must write in Assembly at this point...
Man - if you get convolutional/Reed Solomon working on the Propeller, do share it with us. Post it to ObEx.
Personally, rather than re-invent the radio link I would probably take a different approach: Today you can buy sophisticated radio data modules that have all sorts of capabilities like error correction and mesh. Check out the data radios at www.sparkfun.com. So you can do your link budgets, the radio data sheet or an email to the manufacturer should yield Eb/No curves, transmit power, receive thresholds/RSL, etc. for the radio of interest unless perhaps it is some simple dirt-cheap module used in toys.
Good Luck,
David