Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kyork

Pages: [1]
1
NXPTM M522XX, KINETIS and i.MX RT / Re: UART XON/XOFF
« on: August 29, 2008, 11:48:46 PM »
I don't know if the behavior is correct, but I changed:

Code: [Select]
else if ((XON_CODE == ch) && (tx_ctl->ucState & TX_WAIT)) {
    tx_ctl->ucState &= ~TX_WAIT;                                 // unblock transmitter
    send_next_byte(Channel, tx_ctl);                             // restart transmission, if paused
    return;
}
to
Code: [Select]
else if(XON_CODE == ch) {           
    if (tx_ctl->ucState & TX_WAIT) {
        tx_ctl->ucState &= ~TX_WAIT;                                 // unblock transmitter
        send_next_byte(Channel, tx_ctl);                             // restart transmission, if paused           
    }
    return;
}
in fnSciRxByte() in Tty_drv.c and it fixed my issue.

2
NXPTM M522XX, KINETIS and i.MX RT / UART XON/XOFF
« on: August 29, 2008, 10:23:43 PM »
This may be a simple misunderstanding on my part.  When operating in XON/XOFF mode, should the driver pass those control bytes to the application when fnRead() is called?

Code: [Select]
TTYTABLE tInterfaceParameters;       //table for passing information to driver
QUEUE_HANDLE serialPortId;

tInterfaceParameters.Channel = 1;  // serial 0, 1, 2, 3, 4, etc.
tInterfaceParameters.ucSpeed =  SERIAL_BAUD_57600; // baud rate
tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE;       // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE; // outpu buffer size
tInterfaceParameters.Task_to_wake = 0;
tInterfaceParameters.usConfig = (CHAR_8 | NO_PARITY | USE_XON_OFF | ONE_STOP | NO_HANDSHAKE | CHAR_MODE);    

serialPortId = fnOpen(TYPE_TTY, FOR_I_O, &tInterfaceParameters);
if ( serialPortId != 0 )  // open or change the channel with defined configurations (initially inactive)
{
fnDriver( serialPortId, (RX_ON | TX_ON), 0 );        // enable RX & TX
}

And then later
Code: [Select]
int count = fnRead(serialPortId, inBuffer, inBlockLen);

inBuffer will contain a 0x11, the XON byte.  Should this be the case?  Shouldn't the driver remove those control bytes? 

3
µTasker general / Re: How to use the UART to get data and send data!
« on: August 25, 2008, 11:25:46 PM »
The legacy code is a transport layer driver, the psuedocode is:

driverInit();   //open serial

while( !connected )
{
  fnWrite(RESET); //this sends a RESET frame to the UART device
  fnRead(buffer);
  if( buffer == RSTACK )
     connected = true;
}

The RESET frame is never sent out in this case (I assume because the data is buffered, and sent later by the scheduler).  Is there any way to force the UART driver to write the buffered data?

4
µTasker general / Re: How to use the UART to get data and send data!
« on: August 25, 2008, 10:56:09 PM »
Mark,

I have some legacy code that writes data to the UART and then polls until it gets a response.  Is it possible to write directly to the serial driver?

Thanks

5
µTasker general / Re: How to use the UART to get data and send data!
« on: August 22, 2008, 05:22:28 PM »
Mark,

Thanks for the follow up. 

The problem seems to be some kind of buffering, maybe on the USB/Serial converter.  Here's what I'm seeing happen.

1) Start the Simulator
2) Power up the serial device
3) <no incoming message>
4) Stop Simulator
5) Start Simulator
6) <message expected from #3 reads in immediately>
7) Write command to serial to cause a reset
8) Serial device resets (so obviously writing works)
9) <no incoming message>

I'm going to play with it some more, see if I can narrow down exactly what's going on.

6
µTasker general / Recieving Data via Simulator
« on: August 21, 2008, 09:53:12 PM »
I have a USB->Serial device connected to my PC and I would like to use the Simulator to talk to it.  I have the following simple task setup:

Code: [Select]
void fnApplication(TTASKTABLE *pTable)
{
//initialize
if( state == 0 )
{
TTYTABLE tInterfaceParameters;       //table for passing information to driver

tInterfaceParameters.Channel = DEMO_UART;  // serial 0, 1, 2, 3, 4, etc.
  tInterfaceParameters.ucSpeed =  SERIAL_BAUD_115200; // baud rate
  tInterfaceParameters.Rx_tx_sizes.RxQueueSize = RX_BUFFER_SIZE;       // input buffer size
tInterfaceParameters.Rx_tx_sizes.TxQueueSize = TX_BUFFER_SIZE; // outpu buffer size
    tInterfaceParameters.Task_to_wake = 0;
tInterfaceParameters.usConfig = (CHAR_8 | NO_PARITY | ONE_STOP | RTS_CTS | NO_HANDSHAKE | CHAR_MODE);    

if ( (SerialPortID = fnOpen(TYPE_TTY, FOR_I_O, &tInterfaceParameters)) != 0 )  // open or change the channel with defined configurations (initially inactive)
{
fnDriver( SerialPortID, (RX_ON | TX_ON), 0 );        // enable RX & TX
DebugHandle = SerialPortID;
state = 1;
}
}
else
{
int count = fnMsgs(SerialPortID);
if( count > 0 )
{
unsigned char buffer[MEDIUM_MESSAGE];
int read;

read = fnRead(SerialPortID,buffer,MEDIUM_MESSAGE);
}
}
}

Also, I have #define SERIAL_PORT_0   '8' set in app_hw_m5223x.h

If I reset the device connected to the USB->Serial connection, it sends some data on bootup.  If I connect to COM8 with Hyperterminal, I can see this data come in.  However, the above task never gets a value from fnMsgs() greater than zero.

Am I missing some step to get the Simulators serial emulation to work?

Pages: [1]