MOD54415 UART9

Discussion to talk about hardware related topics only.
nicobari
Posts: 110
Joined: Mon Jan 30, 2012 12:15 pm

MOD54415 UART9

Post 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
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 UART9

Post 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
Dan Ciliske
Project Engineer
Netburner, Inc
nicobari
Posts: 110
Joined: Mon Jan 30, 2012 12:15 pm

Re: MOD54415 UART9

Post 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
nicobari
Posts: 110
Joined: Mon Jan 30, 2012 12:15 pm

Re: MOD54415 UART9

Post by nicobari »

The same code works with UART8!! any suggestions?

Thanks,
TM
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: MOD54415 UART9

Post 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.
nicobari
Posts: 110
Joined: Mon Jan 30, 2012 12:15 pm

Re: MOD54415 UART9

Post 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
nicobari
Posts: 110
Joined: Mon Jan 30, 2012 12:15 pm

Re: MOD54415 UART9

Post 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
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 UART9

Post 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
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 UART9

Post 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) { }
        }
    }
}
Dan Ciliske
Project Engineer
Netburner, Inc
nicobari
Posts: 110
Joined: Mon Jan 30, 2012 12:15 pm

Re: MOD54415 UART9

Post by nicobari »

Thanks, I am still testing but will be back soon with results.
Post Reply