-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set low a pin before bootloading #23
Comments
Maybe it is easier if you just use https://github.com/zevero/avr_boot/tree/gh-pages |
Thanks for the help! |
README.md and the makefile both clearly document how to set the SD CS to any pin you like. If you want a much more simple solution just use the Arduino hardware package, which allows you to just select pin 10 from the Tools > SD CS Pin menu and then do Tools > Burn Bootloader. It doesn't get any easier! Installation instructions and other documentation for the hardware package are found here: |
@per1234 thanks for the help but maybe you didn't understand my problem my CS pin is the pin 10 (PB2) i have another pin for turning on the SD card, the pin 4 (PB4), the bootloader works flawlessly when i set the CS pin on 10 and the pin 4 (PB4) low manually, but i don't want to set this pin manually i hope i can add some code to the bootloader to set it automatically
|
I understand now. The decision of whether to add that feature is up to zevero. It seems like a fairly rare use case since that's not a very common board and the feature can only be enabled on that board by soldering the jumper pads. Maybe you could argue the case by researching whether other boards or shields have this feature and stating whether you would be willing to submit a pull request for the required changes. It would probably be configured in the makefile something like: SD_EN = true # Set the defined SD_EN pin low to enable SD card
SD_EN_PORT = PORTB # Data Register of the SD enable pin
SD_EN_DDR = DDRB # Data Direction Register of the SD enable pin
SD_EN_BIT = 4 # Bit of the SD enable pin I am willing to do the work on the Arduino hardware package to make this feature available via a custom Tools menu in the Arduino IDE if the changes end up being made to the bootloader source and that is considered a desirable feature. |
Ok ... i presumed, that with EN you meant CS. Ok your really mean EN. If you send me a pull-request with a configuration setup as proposed by @per1234 I am happy to add it. Please comment that SD_EN is only needed on boards, where EN is not hardwired, so that other users don't get confused. |
What about something like this?
I added also the configuration to set the enable pin to high or to low, because i saw board where the enable pin goes high.
|
I will not have time to setup, program and test ... but I believe you can do it easily once you look into init_leds(), led_power_on(), etc in main.c and asmfunc.S After looking again into the code I think it may not really be worth the effort to configure everything so verbosely. We could just have SD_EN = true/false and set everything else in spi_pins.h - as done with the other pins... |
Hi, I'm using arduino pro mini ATmega 328/P, but port 4 stays HIGH after boot. I am using the bootloader obtained by arduino's IDE. Is this the expected behavior? |
Hi, on my board to enable the SD card, i need to set low the digital pin 4 (PD4)
there is a way to do this before the bootloader try to access the sd?
Second question, can you provide the configuration of the Makefile for the atmega328p?
Thanks man, i really appreciate your work 👍
The text was updated successfully, but these errors were encountered: