Jump to content
43oh

Stupidest Thing you had to Troubleshoot?


Recommended Posts

Just yesterday I was battling with a atmega328pb (more internal peripherals than standard atmega328p). Specifically I wanted to use the UART1 port to receive data from a GPS. My old setup uses a software serial implementation.

 

After a whole day of debugging this second port not working. I'd concluded UART0 TX and RX worked fine. UART1 TX worked fine, but no RX. My scope was showing the serial stream from the GPS. All the pins were correct.

 

Turns out the AVR wasn't registering the HIGH level from the GPS (3v) as HIGH because it's running from 5v. /facepalm

Didn't even consider it a factor since the atmega328p worked with the 3v signal fine.

 

Adding a level translator and everything just works.

Link to post
Share on other sites

Just yesterday I was battling with a atmega328pb (more internal peripherals than standard atmega328p). Specifically I wanted to use the UART1 port to receive data from a GPS. My old setup uses a software serial implementation.

 

After a whole day of debugging this second port not working. I'd concluded UART0 TX and RX worked fine. UART1 TX worked fine, but no RX. My scope was showing the serial stream from the GPS. All the pins were correct.

 

Turns out the AVR wasn't registering the HIGH level from the GPS (3v) as HIGH because it's running from 5v. /facepalm

Didn't even consider it a factor since the atmega328p worked with the 3v signal fine.

 

Adding a level translator and everything just works.

 

Yeah, VIH levels are tricky. The AVR Mega line is supposed to accept VCC * 0.6 as input high, but that's the minimum. So 3 at 5V. But if your at 5.1V and the input is at 2.9V...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...