Welcome! Log In Create A New Profile

Advanced

Sanguino problems--Solved

Posted by Packhorse 
Sanguino problems--Solved
October 27, 2011 09:23PM
I have just bootloaded my first 644 ( not 644P) with Sanguino and made changes to the boot file as per below so it runs at 8mhz and to use the 644 not 644P
##############################################################

sanguino.name=Sanguino
sanguino.upload.protocol=stk500
sanguino.upload.maximum_size=63488
sanguino.upload.speed=19200
sanguino.bootloader.low_fuses=0xFF
sanguino.bootloader.high_fuses=0xDC
sanguino.bootloader.extended_fuses=0xFD
sanguino.bootloader.path=atmega644p
sanguino.bootloader.file=ATmegaBOOT_644.hex
sanguino.bootloader.unlock_bits=0x3F
sanguino.bootloader.lock_bits=0x0F
sanguino.build.mcu=atmega644
sanguino.build.f_cpu=8000000L
sanguino.build.core=arduino

I then uploaded my project sketch after making the pin changes as it was running on a Mini Pro.
Strangely it takes about 8 seconds before the sketch starts. When it does it all run correctly including timing except for one out of 6 LED's which is on pin D0.
I checked the hardware and its correct. If I short out the pin the LED is connected to with an adjacent LED pin then both LED's flash so this confirms its not the LED or its resistor.

I tried another 644 thinking I may have damaged it. Same thing.
I wrote another simpler sketch as shown below. Its pretty much a cut and paste of parts of the original.
pwm drives a transistor that connects to all LEDs Cathodes to allow for dimming.

int ledoner = 0;      // select the pins for LED one
int ledoneg = 1;  
int ledtwor = 2;     // select the pins for LED two
int pwm=3;
int button = 4;    //button pin 1
int ledtwog = 5;  
int ledthreer = 6;   // select the pins for LED three
int ledthreeg = 7;  


void setup() {
  // put your setup code here, to run once:

}
  
  
  
  void loop(){
    
    digitalWrite(pwm,HIGH); 
    digitalWrite(ledoneg,HIGH);      digitalWrite(ledtwog,HIGH);      digitalWrite(ledthreeg,HIGH);      delay (1000);//green
    digitalWrite(ledoner,HIGH);      digitalWrite(ledtwor,HIGH);      digitalWrite(ledthreer,HIGH);      delay (1000);// orange
    digitalWrite(ledoneg,LOW);      digitalWrite(ledtwog,LOW);      digitalWrite(ledthreeg,LOW);      delay (1000);//red
  }

I get the same 8 second delay before the sketch starts. When it does only the LED on pin D0 works which is the opposite of what was happening with the original sketch problem.


How compatible is a Sanguino with Arduino?
Is there something special about pin D0 on a Sanguino or the 644?
Is it common for such a long delay on power up?
Is there some step I have missed out?

Any help would be appreciated.

Edited 1 time(s). Last edit at 10/28/2011 04:17AM by Packhorse.
Sorry, only registered users may post in this forum.

Click here to login