Continue to Site

# Minimum System of ATmega128

Status
Not open for further replies.

#### satria02

##### Junior Member level 2
i'm sorry.....

no one was connected on i/o port......

#### alexan_e

I don't have a logic solution, usually the problem in cases like this is that the mcu can't establish a connection with the programmer or can't be programmed or evem a code that is not correct but this is not the problem in your case.
You have an MCU that is programmed correctly but the pins don't respond to the code...
Try to transfer the code using the application I mentioned above to see if anything changes.

One more thing to try is to blink the inputs using the internal pull up (pin set up as inputs instead of output ) to see if you get a different result, use a multimeter, you should normally see 0-5v.
The project frequency should be 1000000 since this is your mcu frequency now.

Code C - [expand]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
PORTA = 0xff;  // enable pull ups
DDRA = 0x00;  // post as input

while(1){
_delay_ms(1000); // delay 1 sec
PORTA^=0xff;  // invert PORTA outputs
// PORTA^=0x01;  // or invert PORTA.0 output only

}
}

Alex

Status
Not open for further replies.