Minimum clock speed
What is the minimum clock speed to use FullDuplexSerial at 9600 baud?
Also, are they any naming conventions in Spin? I see methods upper case, lower case; variables with underscores or capitalLetters.
Also, are they any naming conventions in Spin? I see methods upper case, lower case; variables with underscores or capitalLetters.
Comments
I'm not aware of any accepted naming convention. The compiler treats upper and lower case letters as the same.
1. CONstant names in ALL_CAPS.
2. Global VARiables and PUBlic methods Capitalized.
3. Local method variables in lower case.
4. PRIvate methods beginning with _underline.
5. Assembly opcodes and Spin keywords in lower case (except when being discussed in the forum).
6. Hex literals in lower case.
7. Multi-capitialized UpperCaseNames and underline-delimited lower_case_names.
8. Section names (e.g. CON, VAR, etc.) in ALL CAPS.
These conventions certainly are not universal, though. Individual taste still reigns over accepted standards.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
One problem fullduplexserial has is it can be late spotting the start bit, which means it will be late picking up the receive bits. Giving it a very low tolerence for senders that send faster than the baud rate. and most senders dont send exactly at the baud rate.
This tolerence will be lower if the clock is lower, so you may need to adjust the baud rate of the prop around 9600 to get a good sync with the sender.
pcFullDuplexSerial4FC (on the object exchange) has a rx/tx loop of about 265 instructions with 1 serial port enabled. So if you have problems with FullDuplexSerial at low clock rates, you can try that. Its also possible to reduce the instruction count to ~256 instructions by removing the support for the other 3 ports.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
www.sxmicro.com - a blog·exploring the SX micro
www.tdswieter.com
A PICmicro with a system clock speed of 1MHz can handle bit-banged RX or TX at 31250 baud with FIFO buffering and I'd be very surprised if a Propeller Cog couldn't better that given 'waitpxx' and 'waitcnt'.
With the exception of some electronics experience I got from the Navy, this is all new to us. So its really making us learn a lot about micro-controllers, PCB design, RF data communications. All we have so far is a pile of parts on a table and more coming in the mail. I'll post more as the project comes along.
The hardest thing I've encountered so far is finding EagleCAD templates for all the parts, common stuff like RCA and DE-9 jacks. Do people just draw them themselves?