-
Notifications
You must be signed in to change notification settings - Fork 58
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
fix/workaround for SPI too fast #2
base: master
Are you sure you want to change the base?
Conversation
String examples corrections from Federico Vanzati merged.
I intended to make a pull request for an implementation with bit banged SPI too. Since yours predates mine by one year, I think it is only fair to start from your work. My goal is to run ArduinoISP on the Due whose SPI is faster than the AVR based arduinos so bit banging is certainly needed. See: http://forum.arduino.cc/index.php?topic=156764.msg1249822#msg1249822 B.t.w. are you sure you need bit banging on a AVR based arduino? With the SPI clock divider set to 128, like in rsbohn's master, I can program an attiny @1Mhz (maybe yours is clocked lower?) Why is this not yet merged? Maybe because your implemenation still uses the AVR specific SPI registers instead of the SPI lib, like in rs_bohn's master? I need the SPI lib based implementation too, because the implementation with AVR SPI registers does not work on the Due of coarse. My plan is to pull from your master, and rework it to use the SPI lib (minor change), put the bitbang stuff in a mini class with the same interface as SPI. PS: I am also interested in the changes related to not driving the SPI signals when not in programming mode. |
…DYADA_CLOCK=no (don't break existing ArduinoISP shields)
…is selected (not yet implemented)
…asheets under "Serial Programming Algorithm"
…programming; on Due, SerialUSB will be used by default (does not autoreset)
@@ -340,41 +465,39 @@ uint8_t write_flash_pages(int length) { | |||
} | |||
|
|||
#define EECHUNK (32) | |||
uint8_t write_eeprom(int length) { | |||
uint8_t write_eeprom(unsigned length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is missing here. I guess you wanted to write unsigned int.
Has this project been abandoned? It looks like this pull request has been open for over three years now... Any chance for a resolution? |
I would like to pick things up again. I started again from rsbohn's last work and try to fix only things that make ArduinoISP more reliable or more portable to Due, Leonardo... This effort is in my master branch. |
I needed to program a slow clocked ATtiny2313.
Couldn't do it. Errors at various places -- reading signature, reading fuses, sync errors, etc. SPI clock was just too fast for my slow t2313.
I added USE_SPI macro wrapping the built-in SPI support, and added some #else cases with bitbanged SPI support and SUCCESS! Programed my t2313. (critical)
I also did some cleanup of the initialization of the SPI pins. This way the level is set before they become outputs instead of possibly driving one direction then immediately being changed. (possibly important)
And I played a bit with baud rate, SPI config, etc. as you can see. (might be nice to have the #defines)
Thoughts?
(I was using AVRDude 5.10, ubuntu 11.04, arduino 022 with latest arduinoISP sketch, 16mhz ATmega328.)