Welcome! Log In Create A New Profile

Advanced

Pin voltages change during firmware upload or connection

Posted by treynolds416 
Pin voltages change during firmware upload or connection
July 26, 2016 04:49PM
I modified Marlin a bit to be able to use a laser engraving module. I just have the laser controlled by a simple mosfet circuit (controlled by an ATmega2560) and everything is working fine. The problem is that for some reason, the signal pin is written to 5V while I'm uploading firmware or connecting to the printer. Since writing high to the pin triggers the laser, I would like to avoid this. I added a few lines to the setup routine in Marlin_main to write the pin low on startup, but as far as I can tell it doesn't take effect until the printer is completely uploaded/connected, aka when the splash screen goes away.

I'm not sure what stage/function of the firmware controls this (or if it's even something the firmware can affect), so I guess I'm asking for an explanation of what goes on when the board is being uploaded to or when I connect a usb.
Re: Pin voltages change during firmware upload or connection
July 26, 2016 09:19PM
This is the normal behavior while flashing. The "setup"-section is also only available on your ┬Ác after flashing and not while flashing! Disconnect your power supply or invert your logic physically.


Triffid Hunter's Calibration Guide --> X <-- Drill for new Monitor Most important Gcode.
Re: Pin voltages change during firmware upload or connection
July 27, 2016 01:03PM
Thanks for the logic inversion suggestion, that'll work fine for me. I want to know more about this flashing behavior though, is it controlled by a lower level firmware wrapper on arduino, or is it hardcoded into the mega? Does it serve a purpose? Are all of the pins affected in the same way?
Sorry, only registered users may post in this forum.

Click here to login