Welcome! Log In Create A New Profile

Advanced

Sanguino "RepRap Motherboard v1.2" LEDs

Posted by azredhawk44 
Sanguino "RepRap Motherboard v1.2" LEDs
November 23, 2010 11:54PM
I purchased a Sanguino board online the other day, and it's configured as a RepRap mobo. Has a bunch of various connectors all over it... ATX, RS485, 10-pin ribbon connectors, etc.

When I turned it on for the first time, the red debug LED flashed about once a second and the green power LED was on. I thought there was something wrong with it at first but found out eventually that it was just loaded with a basic test sketch to toggle on/off the red LED to prove the thing works.

Evidently, the red LED is wired to digital pin 0.

I configured Arduino IDE to support Sanguino hardware with no issues.

I messed around for a bit and came up with this sketch as a first sketch:

void setup() {
 //setup code 
 
 //5 second delay in case of a wonked program... I can upload
 //a new sketch in that time.
 delay(5000);
 
 //start serial connection
 Serial.begin(9600);
 pinMode(0, OUTPUT);

}

void loop() {
 //main code 
 
 
 //just making a loop to count from 1 to 100, then exit
 //and restart loop()
 
 int myint = 1;
 while (myint < 100) {
  Serial.println(myint, DEC); 
  myint = myint + 1;
  delay(500);
  if (myint == 50) {
    digitalWrite(0, HIGH);
  }else{
    digitalWrite(0, LOW);
  }    
 }
 }

Works exactly like I wanted it to. Yay.

Except: The green LED does not come on. I cannot figure out how the green LED is wired on a Sanguino board. I even tried toggling HIGH the digital pins 0-5. I don't want to toggle all 32 pins hot just to see if it's even wired to an output, because then I have to figure out which one by guess-n-check.

How's the green light turn on on a Sanguino board?
Re: Sanguino "RepRap Motherboard v1.2" LEDs
November 24, 2010 12:16AM
Weird.

I changed my code to:

void setup() {
 //setup code 
 
 //5 second delay in case of a wonked program... I can upload
 //a new sketch in that time.
 delay(5000);
 
 //start serial connection
 Serial.begin(9600);
 pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
   pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
   pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
     pinMode(7, OUTPUT);
 pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
   pinMode(10, OUTPUT);
    pinMode(11, OUTPUT);
     pinMode(12, OUTPUT);
 pinMode(13, OUTPUT);
  pinMode(14, OUTPUT);
   pinMode(15, OUTPUT);
    pinMode(16, OUTPUT);
     
     
}

void loop() {
 //main code 
 
 
 //just making a loop to count from 1 to 100, then exit
 //and restart loop()
 
 int myint = 1;
 while (myint < 100) {
  Serial.println(myint, DEC); 
  myint = myint + 1;
  delay(500);
  if (myint < 17) {
    digitalWrite(myint, HIGH);
    delay(1000);
    digitalWrite(myint, LOW);
  }
  if (myint == 50) {
    digitalWrite(0, HIGH);
  }else{
    digitalWrite(0, LOW);
  }    
 }
 }

Now the green LED turns on.

And stays on through the entire cycle to 99.

Even weirder: I change the code to start myint at 51. The green light is on, even though it would never evaluate to actually run DigitalWrite(myint, HIGH).

How is this green light controlled?
Re: Sanguino "RepRap Motherboard v1.2" LEDs
November 24, 2010 01:10PM
Check the schematic:
[www.reprap.org]

There are only two LEDs on the board, the green one is in the power supply circuit and not controlled by the processor at all. It should always be lit when the board is powered. It might be worth checking that area for a bad connection.
Re: Sanguino "RepRap Motherboard v1.2" LEDs
November 24, 2010 01:37PM
If the green light is connected to power, and your sanguino is powered by an ATX power supply then one of the pins must be connected to the ATX power supply to switch it on. For the Gen 3 motherboard this pin is #14 and needs to be written HIGH in order to turn on the power supply.

maybe that can give you a place to look?
Re: Sanguino "RepRap Motherboard v1.2" LEDs
November 24, 2010 04:04PM
Quote

There are only two LEDs on the board, the green one is in the power supply circuit and not controlled by the processor at all.

Untruthiness. grinning smiley Sorry, but it's not directly wired to the PS circuit, and it is controlled by the processor. I can turn it on or off by doing "something" to pin #14. It's inconsistent.

I played with it some more last night after my last post.

It definitely seems to do something with pin #14.

I am running off an ATX power supply right now.

Explain to me how it has to do with the ATX PSU and pin 14? My board apparently doesn't comply with the schematic posted by Andrew Smith... his schematic shows the green LED being driven by the power circuit, whereas mine obviously is not. I can't "see" any leads from the green LED to pin 14, so it is in between layers of the circuit board somehow if it is related to 14.

If I turn off all the pinMode(x, OUTPUT) except for the ones controlling 0 and 14, it comes on and off as I give a HIGH signal to 14. But it stays off until I give a HIGH signal to 14.

However, the ATX PSU stays powered on whether I write a HIGH or LOW to pin 14... so it doesn't appear to have anything to do with ATX PSU on/off commands.

Still confused, but narrowing in on "something" to do with pin 14.confused smiley
Re: Sanguino "RepRap Motherboard v1.2" LEDs
November 24, 2010 07:16PM
If you follow the earlier link to the schematic, you will see the power LED in the lower right corner of that first box. It is *supposed* to be connected between ground and a resistor. The other end of the resistor then connects back to VCC, which is your 5V supply. If that light is some times on and sometimes off despite your PSU *always* being on, then it may mean there is a loose connection or solder bridge between traces that are not supposed to be connected. Either that, or you have found a reprap derivative where the vender has chosen not to follow the official schematic.
Re: Sanguino "RepRap Motherboard v1.2" LEDs
November 25, 2010 01:06AM
I thought the sketch uploading was in the bootloader, and if the reset pin ...something..., then it would reset it to the bootloader, where you could upload a sketch. by the time it gets to the delay of 5 seconds, then wouldn't the program be in control and it be too late for uploading a new sketch? dosen't the bootloader have its own delay?
Sorry, only registered users may post in this forum.

Click here to login