[SOLVED] Blink Code ATmega2560 not working in Proteus

Status
Not open for further replies.

chandlerbing65nm

Member level 5
Joined
Apr 5, 2018
Messages
80
Helped
0
Reputation
0
Reaction score
1
Trophy points
8
Activity points
709
I am running a simple blink program in an ATmega2560 with external 8MHz crystal. When I run it in Proteus, the LEDs do not blink. Refer to my files below.

This is the simple blink code. I just add prescaler bits to verify its functionality.

Code:
void setup() {
      noInterrupts();
      CLKPR = 0x80;                           /*Enabling the clock prescaler function*/
      CLKPR = 0x00;                           /*Setting the prescaler to div by 1*/
      interrupts();
    
      pinMode(13, OUTPUT);
    }
    
    void loop() {
      digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(500);                       // wait for a second
      digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
      delay(500);                       // wait for a second
    }

I correctly choose the ATmega2560 with external 8MHz.



And this is my circuit in Proteus: (Removing the VDD in reset, AVCC, AREF doesn't help.)



And I set the fuse bits to work with external crystal:



I don't know where I went wrong. Please help.
--- Updated ---

Problem already solved. Pinning in Arduino Mega does not follow actual pinning in ATmega2560. I found the pin map here: Arduino Mega - ATMega2560 Pin Mapping
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…