Author Topic: pull pins low instead of high on startup  (Read 3923 times)

magic.dominic

  • Newbie
  • *
  • Posts: 2
pull pins low instead of high on startup
« on: February 08, 2013, 05:51:56 am »
Is there any way to have all pins be low during the 5 second wait period when powering the digispark? I would like to have my peripheral devices already attached upon power up but not have them start running (with a high signal) during the 5 second wait period.

Thanks for your help

I am aware that removing the 5 second delay would solve my problem, but then again also remove the easy programming feature, which I would like to keep.
related post:
http://digistump.com/board/index.php/topic,320.0.html

semicolo

  • Full Member
  • ***
  • Posts: 137
Re: pull pins low instead of high on startup
« Reply #1 on: February 08, 2013, 06:19:57 am »
Well yes it could be done, but the bootloader needs to be updated again and at some point Bluebie will stop making custom versions for everyone's needs.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: pull pins low instead of high on startup
« Reply #2 on: February 08, 2013, 04:29:22 pm »
No, you can't really do that. Your best option is to buy some attiny85 chips and turn one of your digisparks in to a littlewire usb programmer. You can then use that digispark to upload programs directly in to attiny85 chips without a bootloader.


Trying to hack the bootloader on a digispark to do something like that will just be painful and wont really work as well as you want.


While you're working on your project you can leave the littlewire attached to your chip - it wont interfere with the chip's functioning, and unlike the digispark, when you choose upload in the digispark arduino software it will automatically reset the chip and upload the program - no need to unplug and replug. All you do is go in to Tools > Programmer > USBtinyISP to use the littlewire instead of the digispark bootloader for program uploads.

magic.dominic

  • Newbie
  • *
  • Posts: 2
Re: pull pins low instead of high on startup
« Reply #3 on: February 09, 2013, 11:50:35 am »
ok. Thanks for the info!
I guess since I mostly use it to develop a prototype and in the end if it works will build a custom board anyway and the littlewire seems like a good solution.
There is however one project where exactly this specific bootloader would be great. Could you point me in the direction of how to modify the bootloader myself? (links,guides, documentation, original files??)

Thanks

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: pull pins low instead of high on startup
« Reply #4 on: February 09, 2013, 02:31:50 pm »
Original Files: https://github.com/Bluebie/micronucleus-t85


Compile them using regular avr-gcc. I use version 4.3.3 - I find 4.5.x makes larger hex files. If you get errors when you make, go in to the make file and change the BOOTLOADER_ADDRESS - it's a hexadecimal number - subtract a multiple of 64 (decimal) = 0x40 until it compiles successfully. This address specifies how much space is made available to the user program before the bootloader begins in flash memory.


As for documentation, there are only the comments. Focus mainly on firmware/main.c and the bottom half or so of firmware/bootloaderconfig.h - most things you might want to do can be acomplished by changing bootloaderconfig.h such as changing the timeout, changing how the bootloader decides if it should start or skip straight to user program, or changing how the bootloader decides if it should continue running or time out or something. You can also make it do stuff before it runs and after (just before launching user program) from bootloaderconfig.h