QUOTE(Julets @ Aug 6 2009, 05:02 PM)
I have a few more questions.
1. Where in Kentucky?:-) Kentucky here as well.
2.0 How much room is left to add more functions? ~2K?
2.1 Is there a software emulator for tiny45? I don't have the programmer yet but would like to play.
2.2. Is there a good reference for beginners dealing with tiny45 and C? One that is like a embedded hello world.
3. Which variables should one use to add a 3 shot burst function? Looks like to me I would just add the functions and call them from main();. However, it looks like I would have to recreate the readbuttons() function. Would this work along the lines of something like (but I'm sure this is wrong)...
/* Helps with debugging */
/* ISR never writes */
stepcopy = ratectl.step;
if (BUTTONIN & _BV(PIN_SLOW))
for (i = 0; i < 3; i++ )
if (stepcopy-CTL < stepcopy)
if (BUTTONIN & _BV(PIN_FAST))
if (stepcopy+CTL < (0xFFFFFFFFl>>2))
/* throw dice */
/* worst case we access while in isr and one phase
(1/32)second is jittered */
Maybe a for loop for the value of stepcopy? Sorry, I've had some time off in C and am trying to wiggle back in. I'm not sure what PIN_FAST/PIN_SLOW are and many other things obviously. But, if I could figure out what to play with, I'd might be able to manage. However, again, if I figure that out, I'm still in deep. Deeper in fact because I have never dealt with setting up control functions to change states/modes to something like continuous or burst fire using the tact switches.
Looks like you are big on sigint, that's very handy :-). A lot of jobs out there right now with government contracts looking for someone like you. Several in Cincinnati/Columbus for siginit, seen one posted in Hebron Kentucky earlier this year even. Any ways, I'm straying way off...
Thanks for the work. I hope to be able to do something with this. I was earlier this year (for the first time) working with ASM with gPhoto, but gave up to soon due to the ASM dealings with my Nikon (wish I hadn't, or I'd be versed).
"step" is added to the phase accumulator every clock tick, and the phase acumulator is rounded off to the first 5, most significant digits. The faster we add, the faster we get to the next place in the table, the higher the rate or fire. I copy step out to a local copy, since it has to be volatile , both the timer and the main loop are working with that number, at the same time. Making a local copy speeds things up, and if needed, some places have to stop the timer momentarily to insure variables aren't modified by the timer before it's finished.
While debuging it, I had the code running on an mega16 chip, way too big to actually fit in the controler, and doesn't run on 2volt, but make for an easier platform for developing. I left it in there as a guide on how to change the frequency, and read pin values.
Emulating the avr is easiest to do with the official tools from atmel, astudio is a free download. It's their IDE, assembler, and simulator. Doesn't do c, but it does integrate with winavr, a both free and opensource compiler.
As for space, the tiny45 has more than enough, I plan on splicing into the usb cable, using the last 1k of memory for a usb-bootloader and leaving the other 3k for program. Right now it's using 681 bytes, anything less than 3000 will let me add a bootloader, using usb, and the entire program should be able to be changed in place. So for what it's doing, the tiny45 is overkill, but didn't want to start on an underpowered chip.