Peripheral pin drive issue?

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good day,

 

I'm having an issue with the pin drive when using peripherals such as TWI or UART. What happens is that it doesn't sink/source full voltage, see attached screen shots. It is like there is two levels. 

The MCU is a AVR32DA28. Ignore the absolut voltage levels since I'm using series resistors.

First screen shot is of TWI SCL, where a few clocks have the correct voltage swing while the others don't sink enough. The behaviour is repeatable, always the same clocks which sink properly. The SDA never does the full swing. The second screen shot is of USART signal, where this middle step can also been seen but all the swings go the full way, so not a big issue but might be related.

 

The TWI hardware signal chain is as follows:

 

MCU -> series resistor -> oscilloscope probe -> +5V pull up -> TWI slave.

 

The TWI salve is known good.

 

any ideas what can be causing this?

 

/Niklas

 

Attachment(s): 

This topic has a solution.
Last Edited: Wed. Aug 3, 2022 - 01:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Niklasl wrote:
MCU -> series resistor -

The series resistor (You don't say what value) will prevent the TWI signal from going to GND. The PIN on the AVR may well go all the way to GND however.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for you reply. Please look at the TWI screen shot, the amplitude is different in the same transfer....it is supposed to be the same....the series resistor, with it's voltage divider effect, will not do this. The series is 1k and the pull-up is 10k.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Given that TWI is an active pull-down, passive pull-up buss I don't really understand why you've got series resistors in there at all.

 

By way of an experiment, what happens when you simply set it up properly and only have 4k7 pull-ups connected to SCL and SDA?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I also see that we've not seen any code.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Draw a schematic.

 

Also ensure all chips have both solid gnd  & Vcc connections & that all gnds and Vcc's are solidly tied together.

 

The second screen shot is of USART signal

What do you mean by that?  Please spend 10 seconds to explain clearly.

 

Are ALL AVR power pins properly connected?  Plenty of caps on the power pins?

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Aug 2, 2022 - 01:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
... I don't really understand why you've got series resistors in there at all.
Series termination increases CMOS ESD tolerance; an alternative is an I2C bus buffer as these very likely have a stated ESD tolerance whereas AVR don't other than in the wafer fab qualification data.

 

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

[page 16, mid right]

12.1.5 Input protection 804

[R-TVS-R, R-C-R (100 ns), current divider]

ESD and Transient Protection Using the SP720 | Littelfuse AN9304.4

[page 8, bottom left]

Given the ICS current of -20mA and solving for RI, RI = 397.5Ω

[page 9, first complete paragraph]

While a series resistor at the input to a signal device can greatly extend the level of ESD protection, a circuit application, for speed or other restrictions, may not be tolerant to added series resistance. However, even a few ohms of resistance can substantially improve ESD protection levels. Where an ESD sensitive signal device to be protected has no internal input series resistance and interfaces to a potentially damaging environment, added resistance between the SP720 and the device is essential for added ESD protection. Circuits often contain substrate or pocket diodes at the input to GND or VCC, and will shunt very high peak currents during an ESD discharge. For example, if the HCU04 of Figure 14 is replaced with device having a protection diode to ground and no series resistor, the anticipated increase in input current is 10 times.

 


the only mention

Overview | ZCD | AVR® DA Family

[in second paragraph]

The ZCD applies either a current source or sink to the ZCD input pin to maintain a constant voltage on the pin, thereby preventing the pin voltage from forward biasing the ESD protection diodes in the device.

 

edit :

Level translators have stated ESD suppression; one for I2C or simple UART :

NLSX4373: Level Translator, 2-Bit, 20 Mbps, Dual-Supply (onsemi, datasheet page 1 for greater than 7 KV HBM ESD)

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Aug 2, 2022 - 02:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's a 4 layer board, gnd and vcc is solid with appropriate caps.

 

Series resistor is for protection of devices(current limiting...also ESD as mentioned) and the 10k is simply because it is used in other places on the same card, minimizing BOM. Voltage levels and fall/rise time is acceptable with these resistor and I don't see any reason 4k7 should do anything different. 

 

avrcandice, i'll let you pounder 10s which USART signal uses the USART Peripheral and at the same time drives the line :).

 

Anyway, this is the third thing I found weird with this chip (which is not in the errata) so if anyone haven't seen this issue before I'm leaning to a faulty chip....but I tought asking here before going to replace it. I'll update here if it fixes the issue.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd like to see a scope trace of the AVR pin alongside SCK at the 10K pull up end.

 

I would hope the AVR pin IS getting down to GND (or at least very close).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandice, i'll let you pounder 10s which USART signal uses the USART Peripheral and at the same time drives the line :).

The second screen shot is of USART signal, ​​ 

Both UART lines are driven by signals which can be scoped, don't be vague--the more detail you provide gets to the solution quicker.

 

You forgot to include the schematic...it will probably reveal the cause.

 

First screen shot is of TWI SCL

If your photo is at the SCL pin (you don't definitively say), then yes there is an issue, since if always an output, it should be full hi or lo.

If on the other side of the resistor, then things can get wacky, since issues with the other chips could affect the levels seen on that side.

If the SCL pin reverts to an input (for unexpected reason), then all bets are off---the pin will take on the voltage from the other chips including any pullups (including the AVR)

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Aug 2, 2022 - 05:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like you have a short or a bus contention on the line ie one chip is trying to go high and the other is trying to go low getting about 50% amplitude.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thanks for all the answers, I've found the issue.

 

I was a bit fooled by the scope output, seeing the different amplitudes made me think this was from the MCU. I probed directly at the MCU and to my suprise the signal was fine. So, i removed the TWI slave (only slave) and still the same. At the scope test point there is an ESD diode...it turned out it was a 3.3V diode while the rail now is 5V. Replaced it with correct part and all good.

 

Since a saw this "dual level" on both the TWI and USART (TX) I thought they where linked together somehow. Bu no, the small step on the USART is (most likely) from the diode capacitans...it is driving a PC817 optocoupler input.

 

I will try to be more clear with more information in my next posts. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will try to be more clear with more information in my next posts. 

Once again, remember this from #6 and #10:

 

You forgot to include the schematic...it will probably reveal the cause.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!