Welcome! Log In Create A New Profile

Advanced

ok, endstop checking program...

Posted by [email protected] 
ok, endstop checking program...
February 17, 2013 08:16PM
void setup() {
for (int i=0;i<28;i++)
pinMode(i,INPUT);
Serial.begin(115200);
}

void loop() {
for(int i=0;i<28;i++)
Serial.print(String(digitalRead(i)));
Serial.println(".");
}

anyone experienced with Sanguinololu programming, Did I do this right? I'm trying to check all the input to see if my end stops are working.

With this program, I see no change when I press the button (though I checked the button, at the contacts, it works, and it's a normally closed switch) (though inputs do change states if I put my finger on top of the chip) it's a bought board and it did work before I burnt out the chip(by overheating the hotbed? I think?) anyway, if this program is correct and reads the switch states, what could my problem be?! There's no circuits between the chip and the switch, so it can't be the board... I just switched through 3 chips, so I highly doubt it's the chips..
Re: ok, endstop checking program...
February 18, 2013 03:47PM
You need some delay in loop(), as you read approx 200'000 numbers per second, resutling in about a million characters per second to send. 115200 baud can send about 12'000 characters/s only and your eyes ... I think you get it.

BTW., about all firmwares have either M200 or M119 to report endstop status.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: ok, endstop checking program...
February 19, 2013 07:42PM
I don't believe there's a buffer, and that the characters are printing out as they're read. If I touch the chip, the floating inputs change states, and it's immediate. Those inputs bounce high and low while I'm touching the chip, then drop have to low when I let go. but, even if I hold the contact closed for even a minute, there's no change. I've tried the M119, with the button push and button not pushed, Results always the same..... So I'm thinking I've programmed something wrong on the chip. (I'm using an ATMEGA2560 board to program the Sanguinololu.) I installed the bootloader, I've installed marlin, then I see all this talk about 'setting the fuses' but none of the programs I've used seem to be able to find my Sanguinololu (whether it's hooked directly to the usb, or hooked through the ATMEGA2560.) (I just bought an USBTiny programmer, which I hope will give me more control over programming the Sanguinololu, but it won't be here till Monday....)
Re: ok, endstop checking program...
February 20, 2013 06:31AM
Quote

Those inputs bounce high and low while I'm touching the chip

Sounds like the input is floating, neither connected to 5V nor GND. If your endstops are machanical ones, did you turn on the pullup resistor?

Quote

So I'm thinking I've programmed something wrong on the chip.

Does uploading work at all? Like in a working Blink (from the example sketches)?

Quote

none of the programs I've used seem to be able to find my Sanguinololu

When plugging in the board, an additional serial device should appear. Regardless which firmware you've uploaded, because this device isn't the ATmega, but the USB-TTL adapter chip. In case you're on Windows, did you install FTDI drivers?

... makes me wonder how you program the board without seeing it in the PCs operating system. smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Sorry, only registered users may post in this forum.

Click here to login