Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

MSP430G2231 USI - SPI port interface with ANT AT3 module

Avatar
Rank

Total Posts: 6

Joined 2010-10-28

PM

Hello,
I am using the MSP430G2231 from TI LaunchPad to test SPI with ANT AT3 module using my AP2DK1 dev kit.

1. I have configured the USI on MSP to function as SPI.
2. I have an AT3 module mounted on a battery board (without the battery). board is powered from Vcc/Gnd pins on Launchpad (USB)
3. P1.0 is reset(op), P1.1 is SEN(ip), P1.2 is MessageRdy(op) and P1.3 is SRDY(op).
4. I have soldered connections from Launchpad board breakout to corresponding ANT battery board breakout.
5. I have been monitoring the registers and pins. It seems I have the Tx from MCU (slave) to ANT (Host) working. eg. to tx Assign Channel.
a. I set MSGRDY High->low.
b. Receive SEN High->Low
c. Assert SRDY (5us pulse H-L-H)
d. Receive 0xA5 (SYNC)
e. Assert SRDY (5us pulse H-L-H)
f. Tx length
g. repeat e,f for command, data and cs (xor all SYNC to last data).
h. Receive SRDY High

After this, I expect a response from the ANT module but do not receive a SEN transition H->L that would start a response from ANT->MCU.
Is there any reason for this ?
Can someone point as to what could be wrong ?

-Thank you.      
RankRankRank

Total Posts: 55

Joined 2008-10-24

PM

The control sequence that you described looks okay. It seems the SCLK generated from ANT is correct if you are able to receive the SYNC.

There are two things could cause the ANT no response:
1. The dada byte of the message is not correct sending, most case is the CS or the message length are counter wrong.
2. The SPI port is not properly configured; epically the falling edge or the raising edge of the SCLK and SEN configurations.      
Avatar
Rank

Total Posts: 6

Joined 2010-10-28

PM

Here is the entire command structure to AssignChannel
after asserting SRDY first time, I receive 0xA5
then after each SRDY assertion I transmit
0x03 -length
0x42 -Assign Channel CMD
0x01 -Channel#
0x10 -Channel Type
0x00 -n/w#
0xFB -cs (including 0xA5)

Right after I transmit cs, I see the SEN transition L->H.
You can see the CS and Data Length are correct.

I use a software SEN (I/O port line configured as input) that generates an interrupt on H->L transition. Since it does generate one right after the MRDY assertion, I believe thus interrupt is configured and works correctly.

I am sure the SPI port is correctly configured, because I can transmit all data correctly from MCU to ANT. i.e. After each SRDY assertion, I can see the ANT module generate SCLK and the MCU shifts the byte out. I get a serial interrupt after each byte is transmitted and finally the ANT module pulls the SEN L->H right after I transmit the CS.

It seems, after I transmit the AssignChannel structure, the ANT module does not assert the SEN (H->L) again to send a reply to the MCU.

1. Under what other cases will the ANT module not send a response?
2. Do I need to transmit a 0x4A (reset) right after a hardware reset?
3. What other commands sequence (if any) needs to be transmitted to the ANT module after a hardware reset ? Currently, I transmit the AssignChannel command structure right after reset. Could this be a problem ?      
Avatar
Rank

Total Posts: 6

Joined 2010-10-28

PM

figured out.
was adding bytes and ignoring carry for cs, not XORing. XORing bytes fixed it.
figured out when I plugged in my AP2 module instead of AT3 and luckily (also figured out) the AP2 (not AT3) sends a startup message !
issue resolved.      
Rank

Total Posts: 11

Joined 2010-11-22

PM

Hi,
i have been trying to get this work for a long time but with no sucess. Is it possible for you to be kind enough to share a schematic connection you used between ANT and TI Launchpad and the basic communication code ?

It would be really nice of you if you could help me. Need assistance urgently.

Eagerly awaiting reply
Regards
Pavan      
Avatar
Rank

Total Posts: 6

Joined 2010-10-28

PM

Hi Pavan,
I do not have a schematic. I had made connections as I mentioned in my first post under this topic.
I have attached my GPIO.c and Serial.c
I can attach only one file at a time so check next post for second file.
Use only the code under #define ANT_SPI

good luck. [file name=GPIO.c size=2107]http://www.thisisant.com/images/fbfiles/files/GPIO.c[/file]      
Avatar
Rank

Total Posts: 6

Joined 2010-10-28

PM

2nd of 2 files. [file name=Serial.c size=6349]http://www.thisisant.com/images/fbfiles/files/Serial.c[/file]      
Rank

Total Posts: 11

Joined 2010-11-22

PM

Hi,
Thank you very much. Will go though it. I am really grateful to you.

Thanks in advance.

Regards
Pavan      
Rank

Total Posts: 11

Joined 2010-11-22

PM

Hi,
I see the use of header files, but they seem to be specific and hence is it possible to share them ? And is it possible to spare time to review my connections ?
Regards
Pavan      
Rank

Total Posts: 11

Joined 2010-11-22

PM

Hi, Can u spare time to review the following connections ?

Pin No Pin Name Connection
1 Test GND
2 RST MSP430 Pin1.0
3 VCC VCC
4 GND GND
5 NC
6 SRDY MSP430 Pin1.3
7 SMSGRDY MSP430 Pin1.2
8 NC
9 PORTSEL VCC
10 SCLK MSP430 Pin1.5
11 SOUT MSP430 Pin1.7
12 SIN MSP430 Pin1.6
13 SFLOW GND
14 BR3 GND
15 RESERVED1 GND
16 RESERVED2 GND
17 SEN MSP430 Pin1.1      
Rank

Total Posts: 1

Joined 0

PM

Hi

I just started working on a project using an AP2 module. Right after reset I'm able to get the Startup Frame ok, 0xA4 0x61 0x01 0x00 0xCA if I recall correctly. After I get clocked in the last byte (0xCA) SEN goes high which I had expected. I shortly after Asserted MRDY expecting SEN to get asserted so I can transmit my first command and I can't get ANT to assert SEN, it stays high. Any Idea why that would be happening. I tried another module and same result. What is it that I'm doing wrong.

Thanks
Alejandro      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Alejandro,

Would you be able to describe how your resetting the device? The AP2 does have an external reset pin available to synchronize after startup.

Also, would you be able to send your timing diagrams for the interface? The startup message should be 0xA4 0x6F ...

Regards,
Harrison      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

After some investigation it turned out that the trace that connected the MCU to the ANT Module was broken even though it was not visible to the naked eye. So I en up bridging it with a cable and then it started working right away.

Thanks for the prompt answer.
Alejandro