Pages: [1]   Go Down
Author Topic: Using serial Communications with Leonardo board  (Read 1183 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27118
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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



Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27118
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I solved it.

Thanks
Logged

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey fdyche

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

Pages: [1]   Go Up
Jump to: