Teensy misbehaving with power socket vs laptop

lfm_10

New member
Hi all!

I made a simple project where 3 magnetometers are connected to my teensy 4.1 via SPI communication (using as CS pins 0,1,2). Data is sent via Ethernet to a PC. If I provide power to the card via the micro usb connected to a socket, one of the sensors does not send data. However, when providing power via my laptop, it does send data.
Could it be a ground loop?

Best,

L.
 
Maybe one isn't providing as much voltage as the other? (just a blind guess really) You can check with a voltmeter connected to VIN or VUSB and GND.
 
I suspect you're not getting out of USB Serial wait loop when not connected to USB host (PC) while powered by Vin/GND.
Do you have something like this in your setup.
while (!Serial);

That will wait forever if USB not attached to PC.
You should use
while (!Serial && (millis() < 3000));

...which will wait for up to 3 seconds for USB connection before giving up and running rest of program.
 
Back
Top