9 bit on serial arduino uno?

i am not sure if this is the right place to ask so you mods can move it if needed

i tried to use the suggested code from http://forum.arduino.cc/index.php?topic=38003.0 to read 9 bit serial and i was getting errors

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno"
sketch_mar11a.ino: In function 'unsigned int USART_Receive()':
sketch_mar11a:5: error: 'UCSRnA' was not declared in this scope
sketch_mar11a:5: error: 'RXCn' was not declared in this scope
sketch_mar11a:9: error: 'UCSRnA' was not declared in this scope
sketch_mar11a:10: error: 'UCSRnB' was not declared in this scope
sketch_mar11a:11: error: 'UDRn' was not declared in this scope
sketch_mar11a:13: error: 'FEn' was not declared in this scope
sketch_mar11a:13: error: 'DORn' was not declared in this scope
sketch_mar11a:13: error: 'UPEn' was not declared in this scope

do i need to upgrade the bootloader or does anyone know of any shields that convert 9 bit to 8 bit then back to 9?

if it is the boot loader i need to upgrade does anyone know where i can get the bootloader

sketch_mar11a:5: error: 'UCSRnA' was not declared in this scope
sketch_mar11a:5: error: 'RXCn' was not declared in this scope

You have to replace "n" with the appropriate UART number that you're using. For an Uno, you'd want "UCSR0A", "RXC0", and similar.

i changed all the lines with n to 0

unsigned int USART_Receive( void )
{
unsigned char status, resh, resl;
/* Wait for data to be received /
while ( !(UCSR0A & (1<<RXC0)) )
;
/
Get status and 9th bit, then data /
/
from buffer /
status = UCSR0A;
resh = UCSR0B;
resl = UDR0;
/
If error, return -1 /
if ( status & (1<<FE0)|(1<<DOR0)|(1<<UPE0) )
return -1;
/
Filter the 9th bit, then return */
resh = (resh >> 1) & 0x01;
return ((resh << 8) | resl);
}

and now get error compiling

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
Arduino: 1.0.6 (Mac OS X), Board: “Arduino Uno”
core.a(main.cpp.o): In function main': /Users/username/Downloads/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:40: undefined reference to setup’
/Users/username/Downloads/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:43: undefined reference to `loop’

While you are at it, do go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to mark up each code section as such so we can examine it conveniently and accurately.

Also mark up any data in the same way. This includes error output that you get from the IDE. It is much easier to then see which is code and which is explanation of the problem.

main.cpp:40: undefined reference to setup' main.cpp:43: undefined reference to loop'

Does your sketch have a setup() and loop() defined? or main() ? You can't compile JUST 9-bit uart code and expect anything to work, and the link you referenced is NOT a complete sketch...