Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Ardiuno can’t open channel via Dynastream ANTAP281M4IB

Rank

Total Posts: 5

Joined 2016-12-29

PM

Hi there,

Trying to get a connection going with a Wahoo Speed sensor via a Dynastream ANTAP281M4IB. I'm using an Arduino Uno, with wiring as described here.

I'm a software guy by training. This is my first hardware project, so looking for some help. At the moment, I've got the chip wired for async serial comms at 9600 baud. I'm able to reset the chip via the hardware pin, after which I see a startup message response from ANT:

A4 01 6F 01 CB

After that, I get the silent treatment. I try sending the following:
Set Network Key:
A5 9 46 00 xx xx xx xx xx xx xx xx 65

Assign Channel (channel 4):
A5 03 42 04 00 00 E0

Set Channel ID:
A5 05 51 04 00 00 7B 00 8E

Set Frequency (base + 57):
A5 02 45 04 39 DF

Set Period (8192):
A5 02 43 04 00 E0

Open Channel:
A5 01 4B 04 EB

After each I attempt to read a response, but nothing is coming back. Total radio silence. I'm inclined to think the problem is how I'm handling the RTS/CTS flow control, since, frankly, I don't feel I completely understand it. According to the datasheet "The RTS signal is de-asserted for approximately 50 microseconds after each correctly formatted message has been received (Figure 2-2). This RTS signal duration is independent of the baud rate. Incorrect messages or partial messages are not acknowledged." However the accompanying diagram shows RTS going HIGH after receiving a message, which I would have though was asserting, rather than de-asserting? Anyway after consulting various web sources, I have tried:
- wiring RTS to ground
- wiring to Arduino pin configured as INPUT (not explicitly set HIGH or LOW - maybe a problem?), and after sending each msg:
while (digitalReadCTS_PIN ) == HIGH{}
- wiring to Arduino pin configured as INPUT_PULLUP and hooking an interrupt to trigger on the falling edge of the signal. I'm not seeing this interrupt firing at all:
attachInterrupt(digitalPinToInterrupt(CTS_PIN), waitFALLING);
 .
 .
 
void wait(void)
 
{
  
while (digitalRead(CTS_PIN) != HIGH{}
 } 


I initially had baud set at 57600. I'm not sure if I re-tried RTS to ground since dialling it back to 9600. As a side note, I have also frequently seen the startup message coming back with an incorrect checksum, even at 9600. Wondering if I need to dial the rate back further?

Unfortunately the only diagnostic tool I have available is trace messages sent to a serial monitor over the USB port - no scopes or anything. Any ideas?

     
Rank

Total Posts: 5

Joined 2016-12-29

PM

Been futzing around trying to get this to work. I think I may have fried the chip. Wiring is as before, though without the interrupt (Uno doesn't support external interrupts on pin 7 anyway). From the examples I've seen it seems acceptable just to pause after transmitting to allow time for the RTS signal to pass.

Anyway, now after issuing a hardware reset it spews this non-stop:

FC FC FC FC FC FC FE FC 7E FC FC 7E FC FC FC FC FC FE FC FC FC FC 7E FC FC FE FC 7E FC FC FC FC FC 7E FC 7E FC FC FC FC FC 7E FC 7E FC FC FC 7E FC FC FC FC FC FC FC 7E FC FE FC FE FC FC FC FC 7E FC FC 7E FC 7E FC 7E FC FC FC 7E FC 7E FC 7E FC FC 7E FC 7E FC 7E FC 7E FC 7E FC FC FE FC FC 7E FC FC 7E FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC 7E FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC

Thoughts? Is it dead? It's silent before the reset...I've just stripped the event loop down to this:
if (mySerial.available())
 
{
  Serial
.print(mySerial.read(), HEX);
  
Serial.print(" ");
 
}
 
return; 


Serial is the hardware UART sending data back to the PC over USB. MySerial is a SoftwareSerial instance on Arduino pins 10 & 11 wired to the ANT RX & TX. setup() is reduced to this:

pinMode(LL_ENABLEOUTPUT);  // pull HIGH to enable logic level translator
 
pinMode(RESET_PINOUTPUT);
 
pinMode(CTS_PININPUT_PULLUP);
 
digitalWrite(RESET_PINHIGH); 
 
digitalWrite(LL_ENABLEHIGH); //toggle the logic level shifter on
 
Serial.begin(BAUD_RATE);
 
mySerial.begin(BAUD_RATE);

 
// issue reset
 
digitalWrite(RESET_PINLOW);
 
delayMicroseconds(1);
 
digitalWrite(RESET_PINHIGH);
 
delay(500); 

     
Rank

Total Posts: 5

Joined 2016-12-29

PM

Been futzing around trying to get this to work. I think I may have fried the chip. Wiring as described here.

Previously after hardware reset I was getting a startup response message {A4 01 6F 01 CB} and then the chip stopped responding. Frequently the startup response came with an invalid checksum. Now after issuing a hardware reset it spews this non-stop:

FC FC FC FC FC FC FE FC 7E FC FC 7E FC FC FC FC FC FE FC FC FC FC 7E FC FC FE FC 7E FC FC FC FC FC 7E FC 7E FC FC FC FC FC 7E FC 7E FC FC FC 7E FC FC FC FC FC FC FC 7E FC FE FC FE FC FC FC FC 7E FC FC 7E FC 7E FC 7E FC FC FC 7E FC 7E FC 7E FC FC 7E FC 7E FC 7E FC 7E FC 7E FC FC FE FC FC 7E FC FC 7E FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC 7E FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC

Thoughts? Is it dead? It's silent before the reset...I've stripped the event loop down to just this:
if (mySerial.available())
 
{
  Serial
.print(mySerial.read(), HEX);
  
Serial.print(" ");
 
}
 
return; 


Serial is the hardware UART sending data back to the PC over USB. MySerial is a SoftwareSerial instance on Arduino pins 10 & 11 wired to the ANT RX & TX. setup() is reduced to this:

pinMode(LL_ENABLEOUTPUT);  // pull HIGH to enable logic level translator
 
pinMode(RESET_PINOUTPUT);
 
pinMode(CTS_PININPUT_PULLUP);
 
digitalWrite(RESET_PINHIGH); 
 
digitalWrite(LL_ENABLEHIGH); //toggle the logic level shifter on
 
Serial.begin(BAUD_RATE);
 
mySerial.begin(BAUD_RATE);

 
// issue reset
 
digitalWrite(RESET_PINLOW);
 
delayMicroseconds(1);
 
digitalWrite(RESET_PINHIGH);
 
delay(500); 

     
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

For asynchronous serial (UART) connections you only use A4 for the sync byte when you frame the message. A5 is only used for synchronous serial (SPI). Also, to help deal with the lack of flow control (RTS/CTS) you should pad your messages with [00][00] at the end which is mentioned in the "Interfacing with ANT General Purpose Chipsets and Modules" doc. I've seen serial connections run at 115200 baud using only a 3-wire connection (TX, RX, GND) without checksum errors, but I haven't personally tried with an Arduino.

Regarding the spew...it does potentially look like a chip failure, but you could try a software reset instead to see if it will respond to commands still.