The assignment for this week was to "add a sensor to a microcontroller board that you've designed and read it". I came to the realization that I had a lot of sensors and switches to program in preparation for my final project. I expected I would need an accelerometer to determine verticality, a camera to send images back to a host computer, and stepper motors with limit switches, also (hopefully wirelessly) transmitting data back to the host computer. I feel like my work is cut out for me for the next few weeks, but for a number of reasons, I was most eager to get the stepper motors driven via Arduino, and made this a priority. Additionally, I tried to design and program a Fabduino with an accelerometer attached.
avrdude: verification error, first mismatch at byte 0x0040 0x01 != 0x02 avrdude: verification error; content mismatchThe error varies (in terms of byte location) when I edit the boards.txt file. The ATtiny44 segment looks something like:
attiny44-20.upload.tool=arduino:arduinoisp attiny44-20.name=ATtiny44 (external 20 MHz clock) attiny44-20.bootloader.low_fuses=0xfe attiny44-20.bootloader.high_fuses=0xdf attiny44-20.bootloader.extended_fuses=0xff attiny44-20.upload.maximum_size=4096 attiny44-20.build.mcu=attiny44 attiny44-20.build.f_cpu=20000000L attiny44-20.build.core=arduino:arduino attiny44-20.build.variant=arduino:standardI found in the data sheet that the Stack Pointer Register should be set to 0x3E (0x5E), though I'm not quite sure what the parentheses mean. In the .make file with which the board was originally programmed (Neil's file) the low fuses were set to 0X5E, though I seem to recall there was some discussion about this in class. In the boards.txt file, if I change 0xfe to either 0x5e or 0x3e, I get content mismatch errors at different bytes. But I don't understand why the bootloader is still of any consequence, as my understanding was that it was used to set the fuses once and that was it. As far as I can tell, everything agrees at 20 MHz. I never exactly figured this out. I had problems burning the bootloader (couldn't find .tool files), and after wiping and re-following David's tutorial again with the same issues, I realized the only difference was that he's using the 1.0.4 IDE and I was using the most recent release. So I wiped that and installed 1.0.4, and then everything seemed to work (bootloading as well). Seems silly to have to downgrade...I assume the discrepancy has something to do with the directory structure in the 1.5 IDE installing to the Program Files directory, while 1.0 doesn't...? Anyway, I'm more than happy using 1.0.4 for now just to be able to get some results this week.
#include SoftwareSerial.h const int rx = 0; const int tx = 1; SoftwareSerial mySerial(rx,tx);And then afterwards call any Serial commands using the variable definition "mySerial" instead of just "Serial". For example, Serial.Begin(9600) becomes mySerial.Begin(9600).