This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI manager interference with ANT

I am using the NRF52832 chip on a D52M M8 module, and SDK 15.2.

I have a number of sensors that I am communicating with over TWI using the TWI Manager on two separate channels.  The read transfers are scheduled on a timer running at a period of 240/32768.

Meanwhile I have an ANT broadcast master channel running at a period of 4096/32768.

Running ANTWare in scan mode it skips 1-2 messages exactly once every 15 ANT cycles (every 1.89s).  This is very consistent so I believe the ANT message is not being sent.  The ANT ovserver callback function is running when I would expect though so the message is queued, just not sent.

For testing I am sending the time in microseconds in a test ANT packet, and so i can compare the ANT data with logs i create on the unit, in which i also log the twi status.  The attached excel shows this data.  Hopefully clear what everything means.  

This proves that when the ANT event coincides with a TWI transfer (i.e. in the period where a TWI transaction has been scheduled, but the callback hasn't returned yet) I still get log messages from my ANT callback, but no data is received in ANTWare.  I therefore believe the message is just not getting sent.

For the TWI channels i am using pins 2,3,4,5

From my previous support request ("Use of TWI manager with ANT") I understand that it should be possible to send ANT messages whilst a TWI transfer is in progress.  

I have followed the design guidelines in the module spec sheet.

Debugging I have gone as far as I think I am able to as I cannot look inside the softdevice to see what is going on.  Are there any suggestions on how to debug further, and/or ideas on what I might be doing wrong - sdk_config.h options etc?  

  • Hi,


    Thank you for that.  Yes, poor wording by me, the LDO is on a different board to the D52M is all I am saying here.

    I have logged a support request with Garmin and so will wait to see what they say.  Based on that I will do some testing and report back.

    Thank you.

  • Hello.  I thought I would give an update.

    Garmin have no specific recommendations but concurred with you Kenneth.  They also suggested adding 22pF capacitors on the twi lines to attenuate nosie which could interfere with the radio.

    I have done some more tests and discovered the following:

    • Noise on VCC-GND is very low, and I see no signs of noise at anything around the 400kHz TWI frequency (it was this noise I expected to see).  My oscilloscope only has a sensitivity of 10MHz so wouldn't see anything in the GHz range.
    • Changing the code to just communicate with a single sensor on the same board as the D52 module I still see the drop-out issue. 
    • With a single sensor, the twi transaction is very quick, 200us, and in this case I never see the ANT event occurring during a twi transaction.  However I still see the dropouts when the ANT event occurs right next to (within a few microseconds) of the twi transaction finishing.
    • Powering a single board with the D52 module and sensors (so no regulators or ribbon cable) directly from a bench power supply via soldered leads I still get the dropouts.
    • Soldering leads to a breadboard from the SCL/SDA nets I have added in external pull-ups but still get the drop-outs.
    • I have cut up one of our boards to remove the D52 module and wired the sensors directly to a D52 dev kit module.  Running identical code (even using same pins on both D52 M8 and D52 dev kit modules) I get no dropouts with the dev kit.
    • Back to our boards: we have two joined by a ribbon cable.  One has the D52 module and sensors operating on TWI channel 0.  The other has the regulators and sensors operating on channel 1-both boards have the same sensors on them.  If I just run the sensors on channel 1 then I get no dropouts.  This is interesting  - the sensors and D52 module have separate power supply lines coming across the ribbon cable but share a ground.  Perhaps this is the cause of the issue, some noise on the ground plane?  Since we still get the dropouts using the single board with bench power supply I think we can rule out the ribbon cable.  Problem is isolated to whats going on on the board itself.
    • We have therefore isolated the problem to the board layout.  I think likely as we suspected electrical noise generated by TWI transactions is interfering with the radio.

    If you have any other suggestions based on thsi please let me know.  As the problem is isolated to the board, the only way to test fixes is to make new boards, which is expensive, so I want to be sure to get it right!

    Many thanks.

  • Hmm... Looking at the sceenshot you sent, I can see that all 5 GND pins are traced to a single GND via to the ground layer. In general this is not a good idea, each GND pin should ideally have it's own via close by connected directly to ground layer. Have in mind that all currents (VDD and return paths for GPIO's) will have to go through this single via, so I am not surprised this may contribute to what you are seeing, and that it is actually noise in GND that is the actual problem here.

    I would recommend having more than 1 via on VDD also.

    Best regards,
    Kenneth

  • I think I have enough information now to be confident I can fix this problem.  thank you.

Related