Sending Serial Signals with the Propeller
rcm14
Posts: 11
Hello all.
I am an EE student using the Propeller for a design project. I need to send a serial signal through a laser diode module to communicate with a photosensor both of which are connected to Propeller chips.
My concern is the speed at which I can output the bit stream I need to send. I outputted a simple square wave through one of the pins and connected that pin to an oscilloscope to view the frequency of the output. I used the following code to implement the simple square wave:
PUB FREQ_TEST
dira[0]~~
outa[0]~
repeat
!outa[0]
(I had the clock frequency set to 80MHz)
Using this code, I was only able to achieve a square wave with a frequency of 45kHz. I would like the output speed to be faster than this. Will using assembly make the frequency faster?
Any help and guidance would be greatly appreciated.
I am an EE student using the Propeller for a design project. I need to send a serial signal through a laser diode module to communicate with a photosensor both of which are connected to Propeller chips.
My concern is the speed at which I can output the bit stream I need to send. I outputted a simple square wave through one of the pins and connected that pin to an oscilloscope to view the frequency of the output. I used the following code to implement the simple square wave:
PUB FREQ_TEST
dira[0]~~
outa[0]~
repeat
!outa[0]
(I had the clock frequency set to 80MHz)
Using this code, I was only able to achieve a square wave with a frequency of 45kHz. I would like the output speed to be faster than this. Will using assembly make the frequency faster?
Any help and guidance would be greatly appreciated.
Comments
With this code: you should get a squarewave of 10 MHz at P0.
With the help of a counter the Propeller can generate squarewaves up to ~160MHz !
With the help of the videoshifter you can send serial bitpatterns with 50MHz or more.
Receiving is more tricky but should be possible up to 10MHz.
Andy
http://www.parallaxsemiconductor.com/an001
You can use the counter to experiment with turning on and off a pin at very low frequencies all the way to the props maximum frequency.
If you wanted to test some of the existing serial transmission rates, use for example the Full Duplex Serial object, set the tx pin and baud, and experiment with various frequencies to see if something will serve your purposes to achieve the highest rates possible with the laser diode and photo detector.
You can look at your scope on the photo detector circuit and find out where your signal starts to degrade at what baud.