Bug, One Line Code Issue *Solved (kinda)

SpokePOV kit for bikes

Moderators: adafruit_support_bill, adafruit

Bug, One Line Code Issue *Solved (kinda)

Postby bkingsley22 » Sat May 14, 2011 6:36 pm

Just built three Spoke POV blades and they look awesome !!!

However, I have noticed a weird issue. From some research through the forums it appears to be a bug in the Firmware code. Something to do with the mirroring effect and how a row of lights on one side stay lit. Anyways, I am surprised I have been able to achieve this much. I know how to write some code, enough to change the small defect. Although, to update the firmware I see references to AVR programming and compiling. I have very basic knowledge in even this and with that I have no clue.

Could I beg of someone to explain a step guide to solving this code issue? Thank you so much, I am grateful for any advice.
Last edited by bkingsley22 on Thu May 19, 2011 5:38 pm, edited 2 times in total.
bkingsley22
 
Posts: 3
Joined: Sat May 14, 2011 6:30 pm

Re: Bug, One Line Code Issue

Postby robinver » Sun May 15, 2011 1:28 pm

same issue here... anyone that can help ?
robinver
 
Posts: 1
Joined: Sun May 15, 2011 1:27 pm


Re: Bug, One Line Code Issue

Postby bkingsley22 » Tue May 17, 2011 9:03 am

Hi Arduwino, I am an educator by profession and so I definitely respect your logic. I see that your posts are much less of an easy answer and more of a guiding suggestion. This way, we are led to the answer by our own admission and truly comprehend the content, rather than just follow a given answer.

So, I have continued to research this problem as much as I can. Again, I have extremely basic knowledge in any of this. However, as far as I can tell, to fix this bug I must...

1. -Install AVRDUDE in order to program/flash the AVR microcontroller on each of the Spoke POVs. (Assumes use of USBtiny to program to SpokePOV.)

2. - Find the "main.c" file from the Spoke POV firmware source files. Edit the line of code appropriately as follows:

Line 102 of main.c needs to be changed from
Code:

spieeprom_read_into_leds(anim_eeprom_offset + (1024UL-eepromaddr), BACK);


to
Code:

spieeprom_read_into_leds(anim_eeprom_offset + (1024UL-eepromaddr) - 4, BACK);


3.- Locate the newly edited and saved "main.c" file, along with "makefile" and compile.

4. -Upload the new resulting ".hex" file to each SpokePOV.

Could someone please let me know if I am missing anything. I do not want to update the firmware on the chip and wind up "bricking" it from some dumb oversight. Essentially, am I missing any steps ? All I do is update the "main.c" file. But then what about the other files in the original Firmware folder? All I use to create a new .hex is the main.c and makefile ? Then, all I update to the chip via AVRDUDE is the .hex file ? Or are there other files, procedures I am missing? I saw references to all kinds of adjustment like "fuses", etc.

My head was already swimming from all of this new terminology and language. Any insight is greatly welcomed so that I do not wind up totally screwing up my boards from trying to edit this code. Thanks all.
bkingsley22
 
Posts: 3
Joined: Sat May 14, 2011 6:30 pm

Re: Bug, One Line Code Issue

Postby adafruit_support_bill » Tue May 17, 2011 10:29 am

I come from a family of educators. I guess it must be in the blood. :)

It sounds like you have done your homework and identified the right steps. The only source file you need to modify is Main.c. The other .C and .H files will be automatically included in the build at compile time.

You do not need (or want) to change any fuse settings. The correct fuse settings are already programmed for the SpokePOV. Altering fuses is the most common way to 'brick' a chip and should only be attempted once you have a good understanding of what they do.
User avatar
adafruit_support_bill
 
Posts: 16038
Joined: Sat Feb 07, 2009 9:11 am

Re: Bug, One Line Code Issue

Postby bkingsley22 » Thu May 19, 2011 7:45 am

*Update:

Thank you for the inspiration. After many hours (insert much frustration here) I was finally able to flash the new ".hex" file to the attiny2313. I checked the mirroring option and what do you know...the problem has been solved! What an accomplishment for my amateur abilities. However, as one door closes another opens and now I have a new problem.

None of the buttons are responding. I try battery resets and nothing changes. So, somehow this function got messed even though the only change I made to the "main.c" was the slight addition of that line of code. I do not know enough about this to begin where to identify and fix this new issue.

As an alternative, I found the Jonathan Karpick "blinky" version of the firmware. (Yes, this still has the bug in the code.) I did the exact same steps to change the "main.c" file, compile it, and flash to the boards. For some reason this works as it should, the LED bug is fixed and the buttons remain functional. So, I am at happy to have that !

I would still like to know, for educational purposes, how to diagnose and solve the issue with my first attempt using the original firmware "main.c" file. I am fascinated and intrigued. As inspiration to others....just persist, it can be done if you so desire.
bkingsley22
 
Posts: 3
Joined: Sat May 14, 2011 6:30 pm


Return to SpokePOV

Who is online

Users browsing this forum: No registered users and 0 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [103]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[61]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]