INPUT_PULLDOWN

Post here first, or if you can't find a relevant section!
dannyf
Posts: 202
Joined: Wed May 11, 2016 4:29 pm

Re: INPUT_PULLDOWN

Post by dannyf » Sat Dec 02, 2017 1:22 pm

but almost work
almost surely, except when it doesn't.

a similar trap exists on older the older luminary chips: if your code executes so fast that it disables the debug pins before the connection is made, you will never be able to debug the chip. A recent example is here: https://dannyelectronics.wordpress.com/ ... -lock-out/

luminary's "work-around" is to insert a large delay routine at the very beginning of user space to allow the debugger to kick in before doing anything, so if your code isn't working perfectly, you can still program it.

User avatar
RogerClark
Posts: 7544
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: INPUT_PULLDOWN

Post by RogerClark » Sat Dec 02, 2017 7:29 pm

There are 2 ways to get a STLink to connect even if the pins are disable by the firmware

Put the jumpers on Boot0 to High

Or

use connect under reset

aster
Posts: 119
Joined: Thu Mar 30, 2017 2:41 pm
Location: bella italy
Contact:

Re: INPUT_PULLDOWN

Post by aster » Sat Dec 02, 2017 9:52 pm

dannyf wrote:
Sat Dec 02, 2017 1:22 pm
luminary's "work-around" is to insert a large delay routine at the very beginning of user space to allow the debugger to kick in before doing anything, so if your code isn't working perfectly, you can still program it.
shouldn't be a good idea to put this delay "before" the setup?

in arduino it is something like this:

Code: Select all

void main() {
   init();
   setup();
   while (1)
       loop();
}
i guess it is the same here, the delay could be added between init() and setup(). do you think that people usually need to have the board running immediately the setup() or that 1s of delay could be headache saving?

anyway you should add somewhere in keyword.txt
INPUT_PULLDOWN LITERAL1

this would make the arduino ide colour INPUT_PULLDOWN light blue as INPUT_PULLUP, INPUT, OUTPUT ecc ecc

User avatar
RogerClark
Posts: 7544
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: INPUT_PULLDOWN

Post by RogerClark » Sat Dec 02, 2017 9:56 pm

I can't see how moving the order of when the SWD pins are disabled will help with connecting via STLink etc

The difference in time with be micoseconds

Post Reply