Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Bike Power → Thread

   

Synchronous Reset Problem

Rank

Total Posts: 1

Joined 2017-07-24

PM

Hi!

I am trying to do a SRM to Ant+ adapter according the project of Mark Rages (https://github.com/markrages/antsrm)

My chip is MSP430g2452, which different to the 2231 only by memory size.

When I am running the code on the chip, the ANT+ computer can get the ANT+ Device ID, but the main stucks always on line 55:


43 static inline void ant_phy_reset(void) {
44 // follow the sequence in the doc, 3.4.2
45 int i=0;
46
47 P1OUT |= MRDY_BIT | SRDY_BIT;
48
49 i=100; while (i--);
50
51 P1OUT &= ~SRDY_BIT; // drop srdy,
52 i=4000; while (i--); // wait,
53 P1OUT &= ~MRDY_BIT; // drop mrdy
54
55 while (!(P1IN & SEN_BIT)) // wait for SEN to go high
56 ;
57
58 while (P1IN & SEN_BIT) // wait for SEN to go low
59 ;
60
61 P1OUT |= SRDY_BIT; // set srdy again
62
63 // CKPH=1 CKPL=0;
64 // USIMST=0; USCI2C=0; USCIOE=1;
65 // USI16B=0;
66
67 // init serial port
68 USICTL0 = USIPE7 | USIPE6 | USIPE5 | USILSB /*| USIGE*/ | USIOE | USISWRST;
69 USICTL1 = USICKPH;
70 USICKCTL = USIDIV0 | USISSEL_4; // | USICKPL;
71 USICTL0 &= ~USISWRST;
72
73 }

I checked the documentation on the "Interfacing with ANT General Purpose Chipsets and Modules", Section 3.4.2 and the code seems to be correct (please, correct me if I am wrong).

Has anyone faced similar problems? I know there is the reset-pin option, but it is not included in the board layout, which I am using.

Thoughts? Ideas?