Page 1 of 2

MOD54415 UART9

Posted: Thu Feb 26, 2015 5:44 pm
by nicobari
Hi,
So I am trying to use UART9 on MOD54415 and I am using NBEclipse 2.6.7. I am setting J2[41].function(2) and J2[44].function(2) and then using OpenSerial(9, 115200, 1, 8, eParityNone) to open UART9. However it seems that I am not getting anything when I use read command. The serial communication voltage level from sensor is TTL (not RS232) and I checked J2[41] with oscilloscope and I can see the pulses typical of serial communications, which means the serial signal is reaching J2[41]. Also to see if my UART9 is properly initialized I tried writing to UART9 and I can also see the signal on oscilloscope from J2[44]. What am I doing wrong? I will appreciate any help regarding this matter. Thanks in advance.

Regards,
Tanmay

Re: MOD54415 UART9

Posted: Thu Feb 26, 2015 7:54 pm
by dciliske
Hmm... Interesting. What version of the NNDK are you running? Also, is UART9 the last serial port you open? There's a bug in some of the more recent versions that can clobber the UART pins on the ones shared with the cts/rts pins of the low order ports.

-Dan

Re: MOD54415 UART9

Posted: Fri Feb 27, 2015 5:47 am
by nicobari
I am using version 2.6.7 NNDK. Yeah it is the last serial port pins I am initializing after UART8 And UART2 but I am only opening UART9 in the code. I will try to remove other pins frm pin initialization and see if i solves the issue. However what is the possible solution to the bug? Do I need to download newer version of NNDK? Also when I checked the datasheet for Netburner I found UART8 not sharing any cts or rts with any other UART pins.

Thanks,
TM

Re: MOD54415 UART9

Posted: Fri Feb 27, 2015 7:57 am
by nicobari
The same code works with UART8!! any suggestions?

Thanks,
TM

Re: MOD54415 UART9

Posted: Sat Feb 28, 2015 9:43 am
by rnixon
Not sure what h/w your running the module in, but make sure those pins are not connected anywhere else.
Check the module data sheet and verify you are not using the alternate pin functions anywhere.
I would then make an app that is just a few lines of code to open uart9, verify you can transmit, and then see if you can read.

Re: MOD54415 UART9

Posted: Mon Mar 02, 2015 8:33 am
by nicobari
I checked the code and I am pretty sure that I am not using nay other function multiplexed on J2[41] but I will write a small code to just read data on UART9 and update the results. Thank you.

Regards,
TM

Re: MOD54415 UART9

Posted: Sat Mar 07, 2015 4:27 pm
by nicobari
Hi,
So I tried a bare code which does nothing except opening UART9 and reading incoming data but it seems it is still not working. Any other suggestions?

Regards,
TM

Re: MOD54415 UART9

Posted: Sun Mar 08, 2015 3:01 pm
by dciliske
This seems bugged... I'll take a look tomorrow. I'll either find out what you're doing wrong or what we're doing wrong.

-Dan

Re: MOD54415 UART9

Posted: Mon Mar 09, 2015 10:09 am
by dciliske
So... I don't think this is on our end. This is the test code that I'm running:

Code: Select all

#include <predef.h>
#include <constants.h>
#include <ctype.h>
#include <ucos.h>
#include <system.h>
#include <serial.h>
#include <iosys.h>
#include <pins.h>
#include <init.h>


const char AppName[] = "UART9_TEST";

extern "C" {
    void UserMain( void * pd );
}

void UserMain( void * pd )
{
    init();
    J2[41].function(PINJ2_41_UART9_RXD);
    J2[44].function(PINJ2_44_UART9_TXD);
    int fd_9 = OpenSerial(9, 115200, 1, 8, eParityNone);
//    ReplaceStdio(0, fd_9);
//    ReplaceStdio(1, fd_9);
//    ReplaceStdio(2, fd_9);

    iprintf("Application: %s\r\nNNDK Revision: %s\r\n",AppName,GetReleaseTag());
    writestring(fd_9, "Starting Uart9\n");
    while(1) {
        fd_set read_fds;
        FD_ZERO( &read_fds );
        FD_SET( fd_9, &read_fds );
        if (select( 1, &read_fds, NULL, NULL, 0)) {
            char c;
            read(fd_9, &c, 1);
            while (write(fd_9, &c, 1) == 0) { }
        }
    }
}

Re: MOD54415 UART9

Posted: Wed Mar 11, 2015 9:12 am
by nicobari
Thanks, I am still testing but will be back soon with results.