Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

RTS on asynchronous mode

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hello everybody,...

I have some problem understanding the RTS channel for the async mode..

I have the AT3 module on the development kit. when i connect it to a Rs232 and the Terminal on the PC and i send reset command and then assign channelk command, on the terminal i can see the answer (correct) of the ant module...

So i connect it to a PIC, Rx, Tx and RTS channel on a GPIO...
But with the same commands it doesn't work..

I mean ...

ram int reset1[] = {164,1,74,0,239};
ram int assChan[] = {164,3,66,5,64,0,160};
ram char data3[10];

ram int* ptr;
ram int* ptr2;
ram char* ptr3;
int i;

TRISCbits.TRISC5 = 1; //this is the line of the RTS

ptr=reset1;
ptr2=assChan;
ptr3 = data3;

OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH,
21);

while(1)
{

for(i=0;i<5;i++)
{
while(BusyUSART());
putcUSART(*ptr);
ptr = ptr + 1;
}
Delay10TCYx(50000);

while(LATCbits.LATC5 == 1);
while (BusyUSART());

for(i=0;i<7;i++)
{
while(BusyUSART());
//Delay10TCYx(50);
putcUSART(*ptr2);
ptr2 = ptr2 + 1;
}
Delay10TCYx(50000);
while(LATCbits.LATC5 == 1);

for(i=0;i<5;i++) // Only retrieve len characters
{

data = getcUSART(); // Get a character from the USART
// and save in the string
*ptr3 = data;
ptr3++; // Increment the string pointer
}

}

So, i put the TX, RX line connected also to the PC, so the same line go both to the ANT and the PC... In the screen of the PC i can see the string coming, so they also arrives at the ANT, but when i reach the point that i want to hear the answer of the ANT it seems that nothing happens, ....everything remains hearing...

someone has a problem like this?...

thanks for your help...

I.      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Could you describe in detail about how the AT3 connect to the PC with RS232 and the PIC, do you use the RS232 level shifter?

Have you seen the RTS pin becomes low after the power-up reset of the ANT? You can use oscilloscope to probe this signal.

In asynchronous mode the flow control is performed by the RTS signal, the signal is de-asserted for approximately 50us after each correctly formatted message has been received. The RTS signal duration is independent of the baud rate. Incorrect messages or partial messages are not acknowledged.