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.

[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.

1.png


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

2.png


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

3.png


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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top