problem bringing pin low

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

i have an atmega32 in pdip working ok, but in the tqfp package, when i set a pin to high it outputs 4.7v or so but when i bring the pin low it still outputs 1.3 v or so which the device i'm interacting with sees as a high not a low... why would the chip "leak" volts like that?

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

It sounds like you still have the pin configured as an input. Make sure you set it as an output with DDR.

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

4.7V is pretty low, also.

What is the voltage when you configure the pin as an input? It is almost like there is an external circuit trying to bias it to around 2.5V.

Also, do you have ALL of the Vcc and ground connections made, including AVcc?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

I am setting it to output like this,:
DDRC = 0xFF; //Set Port C for output

Is that correct?

Yes, all Vcc and ground connections have been made, including AVcc.

Port C is connected to pins on this motor control chip that is interpreting the low voltage as high.

http://focus.ti.com/lit/ds/symli...

According to the above datasheet, the voltage being output by the avr does fall outside of the range of what it would consider low (<.8v)

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

What you seeding PORTC to? That controls the pin state, high or low.

Could you have enabled one of the alternate functions on that pin? Do you have access to an oscilloscope to look at that pin. It also sounds like it might be pulsed and you are seeing an "average" with a multimeter.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

I am using pwm but not on port c (I don't think it's available there). I'm using pwm on port d. I'm using adc on port a.

I don't think any other functions are enabled.

I do not have access to a scope.

I'm using commands like PORTC = 3; to change the pin values to 1 or 0.

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

PORTC (bits 2 to 5) are used for JTAG. Do you have JTAG disabled?

Regards,
Steve A.

The Board helps those that help themselves.

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

PORTC's pin 4 is the one I know I'm having an issue with.

I haven't explicitly enabled or disabled jtag. I assume the default is disabled. Should I be explicitly disabling it?

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

Quote:
I assume the default is disabled.

Bad assumption. JTAG is enabled by default. Either clear the JTAG fuse or set the JTD bit in MCUCSR (read the datasheet to see how this must be done).

Regards,
Steve A.

The Board helps those that help themselves.

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

If I disable the jtag fuse, will I still have access to program via ISP programming on the STK500.

I assume yes, but when I change that fuse setting in avr studio it gives me a warning acting like it's a pretty important setting.

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

Yes, you will still be able to ISP program using the STK500. The warning is only important if you were programming via the jtag interface.

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

Disabling the jtag fuse fixed everything. Thanks for all your help!

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

Just a note for the future but if changing the fuse is a bit "fierce" and may preclude your use of JTAG in the future then just do the double write of the JTD bit to disable it.

(I should have got here sooner as you might have found my FAQ#5 useful!)