NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Project Help and Ideas » [LED ARRAY MOD HELP] Adding Even Parity
March 23, 2011 by wArri |
All, Me and some friends wanted to see if we could modify the serial-comm.py that comes with the led_array kit code, to transmitt even parity, as well as modify the uart.c to recieve in even parity. (Then later on we can send a wrong bit stream, and check the error flag register to be notified of an error) We started by modifying the python script to initialize the serial connection with even parity as follow
Then we modified the uart.c to initalize with even parity as well by doing the following: void uart_init() {
When we flash to the board, and run the python script, we no-longer can display anything on the array. Are we missing something in initialization? Are we doing it wrong? Thanks, wArri |
---|---|
March 25, 2011 by hevans (NerdKits Staff) |
Hi wArri, I see nothing wrong in your initialization, and from what I see it should work. My current thought is that PySerial might not actually be sending the parity bit correctly. If you take a look at the documentation it it does say "Enable parity bit checking" on the parameter description, and mentions nothing about generating the bit. It would be very odd for the module not to be doing that correctly, but its possible. There are unused bits in each byte that is sent as part of every character, you could add your own error detection in those bits. Humberto |
Please log in to post a reply.
Did you know that you can connect a computer keyboard to your microcontroller? Learn more...
|