Project Updates for 9/11/2010
I finished getting the autodetect function running, so now the chip has the basic program on it that I set out to do a few years ago. For auto detecting, I just looped through 32 times while waiting for the timer to count from 0 to 0xb000 and looked for activity on any pin. If it saw some, it was set as active by just running activeChannels |= PORTD each time. I also took my timing code and made it a little cleaner and more efficient. The entire program is around 1.5KB, though I have 16KB of total space I can use on the chip.I have been kicking around the idea of using the same chip to send out PWM as well. A simple copy of PORTD to PORTB would probably suffice for normal operation. If I come up with code for sending out pulses (which should be pretty easy), I can do things like have a mode for just holding steering controls in whatever position I left them in. As far as I know, this is one of very few chips that can read 6 RC channels (possibly more) simultaneously, which is why I developed it. Perhaps, after some more work and additional refinement, it could be something to sell, since it's currently very specific to my setup.
I'm also thinking of looking into I2C. I learned a lot working with SPI. In order to get that working, I had to program the arduino and PIC with 2 mismatched configurations and now realize the same thing probably applies to I2C. My main disappointment with SPI is the fact that it takes up not just PORTC, but also uses a pin off the middle of PORTA, rendering it quite useless for many things.
I was looking into expanding the memory for my arduino as well. It appears just popping out the ATmega168 chip, popping in an ATmega328 chip, and programming a bootloader will double it's memory minus the size of the bootloader (about 2K). I'm looking into throwing together a simple AVR programmer as well, which will be required for uploading the bootloader. I placed a sample order for a couple of ATmega328's yesterday, so hopefully those will arrive in the next few days. I looked into using an MMC card with the arduino and found a library called SDFATlib, which would allow access to files that are PC readable. However, the library takes up a considerable amount of size, so the chip upgrade will pretty much be necessary to run that.
So I guess my next steps here are to create PWM generation code, look into building an ATmega Programmer, and take one last look at I2C.