bizzaro interrupt behavior

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

I am using a Ti LED controller that has an XERR pin that according to the data sheet is an open drain transistor that is normally off that I am pulling up with a 100k resistor.  If one of the LED strings goes out the the XERR transistor turns on and pulls the voltage at the XERR pin low.  That all works fine, so I connected the XERR pin to the INT2 pin on an ATmega1284P and configured things to throw an interrupt on the falling edge and enabled INT2 and wrote a little ISR to send out a message over UART.  It all works fine, except the message keeps getting sent over and over.  When I look at the voltage on the XERR pin when I unplug an LED it goes low as it is supposed to, but on the scope there is a 1.5 ms wide square pulse up to 5V every 45 ms.  When I disconnect XERR from the INT2 pin on the ATmega the pulse goes away and the XERR voltage stays low.  When I reconnect the XERR pin to the INT2 pin I get the pulse back every 45 ms, which triggers the interrupt on the falling edge.  What in the world could be happening every 45 ms?  That is an eternity at 16 MHz.

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

Is the INT2 pin set as an output??

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Assume you have a good common ground.

 

Is your power supply up to spec for the LEDs?

 

The power supply could easily thermally oscillate or current overload at 45 mSec.

 

JC

Last Edited: Mon. May 4, 2020 - 01:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Link for th DS please

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

js wrote:
Is the INT2 pin set as an output??

No, input with internal input resistor enabled

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

DocJC wrote:

Is your power supply up to spec for the LEDs?

 

The power supply could easily thermally oscillate at 45 mSec.

 

The LED power supply is a pretty good one.  The 5V supply for digital power is a wall wart.  I could change that and see what happens.

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

ki0bk wrote:
Link for th DS please

 

The ATmega1284P datasheet is too big to upload.

Attachment(s): 

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

DocJC wrote:
The power supply could easily thermally oscillate at 45 mSec.

I changed the digital 5V to my big analog power supply and the 1.5ms square pulse remains every 45ms when XERR is connected to INT2.

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

100k sounds a little weak for a pullup.  What happens if you try say 10k?

Letting the smoke out since 1978

 

 

 

 

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

ki0bk wrote:
Link for th DS please

 

Here is the link for the ATmega1284P-PU

 

http://www.microchip.com/mymicro...

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

digitalDan wrote:
100k sounds a little weak for a pullup.  What happens if you try say 10k?

 

That is what the data sheet shows.  Same with 10k.

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

It is so weird that the interaction between the two chips causes a 1.5ms square pulse every 45ms.

 

Maybe it's the breadboard.  Those things are always nothing but trouble.

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

What baud rate are you using for the UART?  See if blinking an LED will do instead - I'm thinking what takes 45ms is your UART notice.  Just an idea - oh, and I'm sure you've tried the TI chip cut off from the AVR but including the pullup.

 

  S.

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

Scroungre wrote:
What baud rate are you using for the UART?  See if blinking an LED will do instead - I'm thinking what takes 45ms is your UART notice

Correct.  9600 baud.  I turned off the notice and the pulses got much closer together.

 

Scroungre wrote:
Just an idea - oh, and I'm sure you've tried the TI chip cut off from the AVR but including the pullup.

Yes, without the XERR to INT2 connection and the pullup the XERR just goes low when I pull out an LED.  No pulses.

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

Duh, I think I know what it is.  Something I am doing to get the status bits makes the XERR pin cycle between dead LED and over temperature, which causes the pulse.  Sorry guys.  Just me being thick again.  And I tried blaming it on the ATmega.  Software guy says hardware problem.  Hardware guy says software problem.  I'm pretty sure I know what it is.  

 

Thanks guys.  Sorry for wasting time.

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

Figure 12 in the datasheet show that XERR can pulse.
Are you regularly updating the LEDs every 45ms ?
When you disconnect the TLC5940 XERR line to the Mega1284 is the pullup resistor still connected to the TLC5940 XERR pin ?

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

Software guy says hardware problem.  Hardware guy says software problem.

Sack both of them! cheeky

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Its a feedback loop.  The LED dies, XERR goes low, I have to pulse the BLANK pin to get the status bits out to see which channel died, which toggles the meaning of XERR from dead LED to over temp, and XERR toggles because the chip is cool, and it throws another interrupt, which starts the whole thing over again.  I should have known beforehand.  O well.  It makes it a good day because I learned something.

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

mikech wrote:
Are you regularly updating the LEDs every 45ms ?

No.  Scroungre was right.  The 45ms was from the 9600 baud UART.

 

mikech wrote:
When you disconnect the TLC5940 XERR line to the Mega1284 is the pullup resistor still connected to the TLC5940 XERR pin ?

Yes

 

js wrote:
Sack both of them! cheeky

Good idea.  It would make my life much easier.

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

mikech wrote:
Are you regularly updating the LEDs every 45ms ?

Mike, that was indeed the correct question.  I'm impressed.  Thank you.  I was updating all the LEDs when XERR went low so that the voltage at each of the still live TLC pins was high enough for the status bits coming out to be meaningful.  Hence the pulse in XERR, and the feedback.  Using an interrupt was the wrong approach.  My mistake.  I have to say you guys are all so cool, and thanks so much for the sounding board and help.

 

MarkThomas wrote:

js wrote:

Sack both of them! cheeky

 

Good idea.  It would make my life much easier.

 

I say that because I am both on this project.  And I must say, John always has the greatest ideas.