The status of the project is the core works fine now. The supported IOs are eeprom,
watchdog, self-programming (ie bootloader), external interrupts (INT0 etc),
IO ports (including pin interupts), 8&16 bits timers (well, some of the modes),
-SPI master & slave, and the UART with tx&rx interrupts.
+SPI master & slave, ADC, and the UART with tx&rx interrupts.
+
+The only notable missing bits are i2c and XMEM bus access (for the big Megas)
gdb support is implemented and works great (minus watchpoints).
This is a real life project, see enclosed JPEG.
-At atmega168 drives 4 74HC595 shift registers to drive 6 LEDs. 3 Buttons
-provite an interface for "start", "stop" and "reset" of the timer.
+At atmega168 drives 4 74HC595 shift registers to drive 64 LEDs. 3 Buttons
+provide an interface for "start", "stop" and "reset" of the timer.
The timer handles multiple days by switching to display "hours + minutes"
instead of "minutes + seconds" after an hour.
AVR_IO_REGBIT(TCCR1B, WGM12), AVR_IO_REGBIT(TCCR1B, WGM13) },
.wgm_op = {
[0] = AVR_TIMER_WGM_NORMAL16(),
- // TODO: 1 PWM phase corret 8bit
- // 2 PWM phase corret 9bit
- // 3 PWM phase corret 10bit
+ // TODO: 1 PWM phase correct 8bit
+ // 2 PWM phase correct 9bit
+ // 3 PWM phase correct 10bit
[4] = AVR_TIMER_WGM_CTC(),
[5] = AVR_TIMER_WGM_FASTPWM8(),
[6] = AVR_TIMER_WGM_FASTPWM9(),
AVR_IO_REGBIT(TCCR3B, WGM32), AVR_IO_REGBIT(TCCR3B, WGM33) },
.wgm_op = {
[0] = AVR_TIMER_WGM_NORMAL16(),
- // TODO: 1 PWM phase corret 8bit
- // 2 PWM phase corret 9bit
- // 3 PWM phase corret 10bit
+ // TODO: 1 PWM phase correct 8bit
+ // 2 PWM phase correct 9bit
+ // 3 PWM phase correct 10bit
[4] = AVR_TIMER_WGM_CTC(),
[5] = AVR_TIMER_WGM_FASTPWM8(),
[6] = AVR_TIMER_WGM_FASTPWM9(),
[7] = AVR_TIMER_WGM_FASTPWM10(),
- // TODO: 8 PWM phase and freq corret ICR
- // 9 PWM phase and freq corret OCR
+ // TODO: 8 PWM phase and freq correct ICR
+ // 9 PWM phase and freq correct OCR
// 10
// 11
[12] = AVR_TIMER_WGM_ICCTC(),
void mx4_reset(struct avr_t * avr);
/*
- * This is a template for all of the x4 devices, hopefuly
+ * This is a template for all of the x4 devices, hopefully
*/
struct mcu_t {
avr_t core;
void mx8_reset(struct avr_t * avr);
/*
- * This is a template for all of the x8 devices, hopefuly
+ * This is a template for all of the x8 devices, hopefully
*/
struct mcu_t {
avr_t core;
int state; // stopped, running, sleeping
uint32_t frequency; // frequency we are running at
// mostly used by the ADC for now
- uint32_t vcc,avcc,aref; // (optional) voltages
+ uint32_t vcc,avcc,aref; // (optional) voltages in millivolts
// cycles gets incremented when sleeping and when running; it corresponds
// not only to "cycles that runs" but also "cycles that might have run"