Page 1 of 1

UART 9 not working on Nano

Posted: Sat Apr 06, 2013 8:53 am
by Lachlanp
Because of the use of lines for other things, i need to access UART 8 and 9. UART 8 works exactly as expected but U( does not.

UART 9 is connected to the CAN tranceiver. I have removed this device so ther is no conflict.

When I execute the command
RF_FD = OpenSerial( 9, 9600, 1, 8, eParityNone );
the UART9 TX pin (P3 pin 5) should go to a high logic level but it stays at zero.

When I execute the same command on UART8
RF_FD = OpenSerial( 8, 9600, 1, 8, eParityNone );
the UART8 TX pin (P3 pin 12) goes to a high logic level as expected.

Can anyone suggest why UART 9 may not be working.
By the way, I also checked data with both a scope and a loop back test.

RF_FD = OpenSerial( 9, 9600, 1, 8, eParityNone );
writeall( RF_FD, (char *)txd, PACKET_LENGTH );
OSTimeDly(10);
read_nbr = ReadWithTimeout(RF_FD, (char *)rxd, PACKET_LENGTH, 3);

does not provide any data when a short is put across P3 pins 3 and 5 while the exact same code (but using UART8) works perfectly in the loop back test when i short P3 pins 12 and 14.

Is there something in the CAN library that needs to be disabled?

Thanks
Lachlan

Re: UART 9 not working on Nano

Posted: Sat Apr 06, 2013 9:06 am
by versamodule
U8 & 9 does work fine as long as you remove U7 from the kit.


fds9=SimpleOpenSerial(9,115200);
writestring(fds9,"Hello World");

Re: UART 9 not working on Nano

Posted: Sat Apr 06, 2013 9:08 am
by seulater
did you set U9 for serial first ?

// Configure COM 9 Pins as Primary Function
Pins[20].function(PIN_20_UART9_RXD );
Pins[22].function(PIN_22_UART9_TXD);

Re: UART 9 not working on Nano

Posted: Sat Apr 06, 2013 11:37 am
by Lachlanp
Thanks that works. So easy when you know how.

Interesting that I did not have to do that for U8. I preseumed the SerailOpen function set that up. Apparently not.

Thanks again.
Regards
Lachlan