I'm struggling to get rid of some noise that is creeping into analogRead() measurements in a sensitive analog circuit based on a custom Teensy 3.2 board.
After thorough investigation, I find that the noise is generated when data is sent over the USB.
I determined this by adding a function to the usb_tx method inside usb_dev.c that zero's out an ellapsedMicros timer. I find that the noise always comes between 0 - 1200 microsecond after the call to usb_tx.
1. Is there a hardware solution to my problem? Can I put an extra cap somewhere to minimize the noise?
2. Assuming there's no hardware solution, is there a better place for me to zero my timer than the usb_tx method? 0-1200 is not bad, but if I could get it in the range of 0-300 microseconds, I'd be much happier.
Here's a quick pic of the power section of my board. The regulator is in the top right hand corner. The USB connector is just barely visible in the bottom left. The other regulator is for a DC barrel connector so the device can be powered without USB. The issue is not with my custom board as the noise is also apparent with an off-the-shelf Teensy 3.2.
After thorough investigation, I find that the noise is generated when data is sent over the USB.
I determined this by adding a function to the usb_tx method inside usb_dev.c that zero's out an ellapsedMicros timer. I find that the noise always comes between 0 - 1200 microsecond after the call to usb_tx.
1. Is there a hardware solution to my problem? Can I put an extra cap somewhere to minimize the noise?
2. Assuming there's no hardware solution, is there a better place for me to zero my timer than the usb_tx method? 0-1200 is not bad, but if I could get it in the range of 0-300 microseconds, I'd be much happier.
Here's a quick pic of the power section of my board. The regulator is in the top right hand corner. The USB connector is just barely visible in the bottom left. The other regulator is for a DC barrel connector so the device can be powered without USB. The issue is not with my custom board as the noise is also apparent with an off-the-shelf Teensy 3.2.