Pages: [1]   Go Down
Author Topic: Differences between Arduino Mega schematic and example program  (Read 393 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm playing around with an Arduino Mega 2560 (SainSmart manufacture), and I'm confused by a disparity between the schematic and the standard example "Blink" program.

The schematic indicates the built-in LED is on PB7/pin 26. However, the Blink example uses pin 13.

I've confirmed the LED is indeed on pin 13, but changing the pin number and re-uploading the Blink program, confirming it doesn't blink, reverting it to pin 13, re-uploading, and confirming it blinks. This is frustrating, because now I can't trust the schematic for predicting which pins I should use.

Why does the actual device have a different pinout than the official schematic? Is SainSmart mis-wiring their version of the board or am I missing something?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25730
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're missing the fact that the pin number on the AVR is not the Arduino pin number.

In fact, if you look carefully at the schematic you posted, AVR pin 26 (PB7) is connected to both Arduino pin 13 and IC7A, the buffer for the LED.
« Last Edit: February 23, 2013, 08:32:09 am by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're missing the fact that the pin number on the AVR is not the Arduino pin number.

In fact, if you look carefully at the schematic you posted, AVR pin 26 (PB7) is connected to both Arduino pin 13 and IC7A, the buffer for the LED.

Thanks. Yeah, I missed that. I didn't realize the pin number used in the code was different from the actual chip pins.
Logged

Pages: [1]   Go Up
Jump to: