Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

atmega644p internal pullups

Status
Not open for further replies.

sherazi

Banned
Joined
Feb 15, 2010
Messages
388
Helped
61
Reputation
126
Reaction score
61
Trophy points
1,318
Location
Muscat, Oman, Oman
Activity points
0
unable to use internal pull ups for PORTC on ATmega644p

tried this test code with pins not connected to anything , the result expected is blinking LEDS at portb but iam getting them glowing continously as the Leds are sinking current !

Code:
int main()

{

DDRC=0;
PORTC=255;
DDRB=255;
PORTB=0;
while(1)
{
while (PINC==0xff)
{

_delay_ms(250);
_delay_ms(250);
PORTB=0;
_delay_ms(250);
_delay_ms(250);
PORTB=255;



}

PORTB=0;

}

}
 

Whenever I read for an I/O problem in AVRs that have JTAG I immediately think about the JTAGEN fuse.
PORTC is the JTAG port and the JTAG fuse is enabled by default so have you disabled JTAG?
 
  • Like
Reactions: sherazi

    sherazi

    Points: 2
    Helpful Answer Positive Rating
From the device fuses, set the the JTAGEN fuse to 1 (unprogrammed) to disable JTAG.

Alex
 

This is described in the datasheet

25.10Programming via the JTAG Interface
Programming through the JTAG interface requires control of the four JTAG specific pins: TCK,
TMS, TDI, and TDO. Control of the reset and clock pins is not required.
To be able to use the JTAG interface, the JTAGEN Fuse must be programmed. The device is
default shipped with the fuse programmed. In addition, the JTD bit in MCUCSR must be cleared.
Alternatively, if the JTD bit is set, the external reset can be forced low. Then, the JTD bit will be
cleared after two chip clocks, and the JTAG pins are available for programming. This provides a
means of using the JTAG pins as normal port pins in Running mode while still allowing In-Sys-
tem Programming via the JTAG interface. Note that this technique can not be used when using
the JTAG pins for Boundary-scan or On-chip Debug. In these cases the JTAG pins must be ded-
icated for this purpose.
During programming the clock frequency of the TCK Input must be less than the maximum fre-
quency of the chip. The System Clock Prescaler can not be used to divide the TCK Clock Input
into a sufficiently low frequency.
As a definition in this datasheet, the LSB is shifted in and out first of all Shift Registers.

I use the JTAGEN fuse.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top