Thanks for the older versions. I tried them all with 5v and with battery/motor. No luck:
flea101_dt1a.asm: set duration ok w/5v & battery-motor but motor needs push
site hex file: same although binary is different
flea101_dt1a-working great.asm: 1 flash w/5v & every other switch press but no set duration, nothing at all w/battery-motor
flea101_dt1a-ff working.asm: short&long flash w/5v but no switch function,long flash w/battery-motor but then nothing at all
flea101_dt1a-with ff code diabled.asm: short blink w/5v & battery-motor but no switch function
flea101_dt1a-working.asm: short flash w/5v & battery-motor but no switch function
I tried several fuse setting including dfa4 (original 6a), c1e4 (app,no wdt,8mhz), and 81e4 (wdt). Your program has WDT code but when enabled only get dim glow of LED. What hex bytes did you use for fuse?
I started debugging with LED (poor mans breakpoint) and suspect motor startup code is defective. Could see no resemblance to Bernhards original routines, i.e. he uses MCUCR etc. but no hint of that in yours.
Did you start with the fblmc101.asm file? It's serial only according to him.
Your version does not compile with UART enabled. There are references on RCG to other versions but I am not aware of. What does SBL-Flea mean?
Another fellow on a different site is having same problems. At least I don't feel so bad.
I'm not quite a beginner having created hundreds of embedded designs since
late 70s favoring AVR since it appeared mid 90s. Many of my clients products made it to market. I don't have extremely high IQ though and have difficulty debgging/understanding others code. Have blown a few ESCs. Last "snap-crackle-pop" was July 4th, very appropriate.
I'd really like to write a program that just starts motor (maybe turns it off after few seconds too). The UART/I2C stuff just complicates thing for me at this point. I can add free flight etc. functions from that point.
What motors did you use? Did you try the files you posted? What fuse bytes?
Originally Posted by David T
We have not heard from Mike again on this thread so I will assume our answers pointed him in the right direction. I recommended using an existing design so Rich's inquiries seems a relevant continuation to me.
Rich, the differences between source and hex on the free flight version were probably due to late changes. The source should be the most recent.
I had problems getting it to work initially. I changed so many things I can't remember what the breakthrough was. Advice I will give though is once you get it working keep a copy before making more changes! To that end, I have taken the last four versions that I noted in the file name as 'working'. They are in a zip file on my site. Hopefully these will help you find one that works and then debug from there. I have some older version with fewer mods if these don't work.
I used the LED, beeps and EEPROM for debugging. For instance, add code to switch the LED on before branching to state1 to confirm that the program gets that far. Then keep moving it down the program until you find where the LED does not switch on. Comment out the call to evaluate_stall as it may be preventing the motor from running. I had problems writing to EEPROM sometimes so comment those steps out perhaps. Measure current draw to see if fets are on or off while the motor is not running.
Hopefully my older versions will help. Please let me know if you find any bugs or can improve the code.