SO, now that I have successfully gotten my homebrew ATMega2561 arduino-compatible to talk to the IDE, accept a program via the USB port, and generally not cause me headaches, it's time to coax it into actually doing useful things.
This is a big project for me-there is a LOT going on that the processor needs to handle. It's a multi-band, dual-modulation, digitally tuned, radio transmitter/receiver. Currently, 3 or 4 bands and three modulation modes are "within reach" hardware-wise. I don't think I would need to expand this software past 4 bands, and maybe adding digital modulation modes later on or in a different project.
I have to do the following:
- Display frequency, band, modulation, and power on the 2.8" LCD display.
- Input from four pushbuttons
- input from transmit key
- Input from rotary encoder
- analog input for RF power output
- analog input for RSSI
- control three banks of relays for bandswitching
- control transmit/receive switching
- control modulation mode select relays
- TWI-bus controlled SI5351 local oscillator
- Selectable power output (analog? digital? I2C softpot?)
So far, I've accomplished the following on an Arduino Uno, one at a time:
- Setup the 2.8" TFT display and print static data to learn how to print to the display
- read an analog sensor and run the input through a simple equation
- toggle a digital output
- read a rotary encoder (digital input, it works, but it's terrible
- read and debounce a pushbutton(digital input)
Clearly, I have some work to do. Also, I need to get all these things to happen at once, instead of a single sketch at a time. I am a hardware guy-my software skills are akin to the contents of Jeremy Clarkson's toolbox, but given enough time I can get it to work. I DO have extensive libraries and code examples to work with-but a LOT of them are targeted at different ATmega platforms, and a lot of them are just standalone examples on how to use a product/system/part.
Now, it's clear that this is a big job-I have plenty of room (I hope) to get it done, but I have no idea of the architecture of a program this large. How would you lay out this program, and why do it that way? Is there a "normal" way of doing this or is it just a "slap it together, if it works it's not shit!" situation?