Go Down

Topic: Using serial Communications with Leonardo board (Read 1 time) previous topic - next topic

fdyche

I need to do some 9 bit to 8 serial communications, how Windows and the .NET framework handles serial comm and such I get framing errors from the device that uses 9 bit
because I have to emulate 9 bit serial with mark and space parity.
how do I configure 9 bit serial on the arduino and what is the easy way to manipulate the 9 bit, normally the parity bit when doing it with a 8 bit UART.

PC (host) <-> Arduino Leonardo <-> Game

I do not wish to move my PC program to the Arduino Leonardo (just get it to handle the bit twiddling that causes me many errors that I have to trap in the program on the PC.
it is so bad that the game repeats responses


CrossRoads

Need to read section 18 of the '32U4 data sheet, describes setting up the registers & stuff for 9-bit serial on the UART.
There's C examples of functions to use, even 9-bit examples.
http://www.atmel.com/Images/doc7766.pdf
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

fdyche

the only thing that document shows is the C compiler but it does not say what C development environment to use.

I figured by now some one would have already tackled 9 bit serial that could be adapted for what I need
Also I the device I am doing the 9 bit protocol only responds when the host polls it.

What is a good way to detect the first byte sent from the host, so I the arduino code does not accidentally set an address bit in the middle.
Also for polling the device I have to send out 2 bytes (80 and 81 hex) with the 9bit set.

I am wondering would it be better to have the arduino do that polling, instead of the PC




CrossRoads

You could try searching the Playground, searching the Forum. I've not personally done anything.

I don't think the compiler matters - put the functions into the IDE and see if they compile ok.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.


schmid01

hey fdyche

how did you solve your topic in the end? would be kind reading that. Thanks :smiley-mr-green:

Go Up