Change ARCH and MCU settings to match chip signature
This commit is contained in:
4
Makefile
4
Makefile
@@ -9,10 +9,10 @@
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
VERBOSE := false
|
VERBOSE := false
|
||||||
ARCH := m1284p
|
ARCH := m1284
|
||||||
#FREQ := 18432000UL
|
#FREQ := 18432000UL
|
||||||
FREQ := 8000000UL
|
FREQ := 8000000UL
|
||||||
MCU := atmega1284p
|
MCU := atmega1284
|
||||||
ASP := usbasp
|
ASP := usbasp
|
||||||
CC := avr-gcc
|
CC := avr-gcc
|
||||||
LD := $(CC)
|
LD := $(CC)
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ int PWM_Init(void)
|
|||||||
// Register, these bits control the counting sequence of
|
// Register, these bits control the counting sequence of
|
||||||
// the counter, the source for maximum (TOP) counter
|
// the counter, the source for maximum (TOP) counter
|
||||||
// value, and what type of waveform generation to be used.
|
// value, and what type of waveform generation to be used.
|
||||||
// See page 115 of the ATMega32A data sheet for all modes.
|
|
||||||
|
|
||||||
// Mode WGM13 WGM12 WGM11 WGM10 Timer Mode TOP
|
// Mode WGM13 WGM12 WGM11 WGM10 Timer Mode TOP
|
||||||
// 14 1 1 1 0 Fast PWM ICR1
|
// 14 1 1 1 0 Fast PWM ICR1
|
||||||
|
|||||||
13
src/main.c
13
src/main.c
@@ -12,7 +12,6 @@
|
|||||||
// TODO: Config header for chip specifics like EEPROM size.
|
// TODO: Config header for chip specifics like EEPROM size.
|
||||||
// TODO: Check thermistor conversion results /w thermometer.
|
// TODO: Check thermistor conversion results /w thermometer.
|
||||||
// TODO: Implement primary state machine for update loop.
|
// TODO: Implement primary state machine for update loop.
|
||||||
// TODO: Migrate to ATMega 1284P-PU for 2nd 16-bit timer.
|
|
||||||
// TODO: Use 18.432MHz quarz crystal, burn required fuses.
|
// TODO: Use 18.432MHz quarz crystal, burn required fuses.
|
||||||
// TODO: Implement optional CRC8 sensor measurement check.
|
// TODO: Implement optional CRC8 sensor measurement check.
|
||||||
// TODO: Proper error handling and recovery (after testing).
|
// TODO: Proper error handling and recovery (after testing).
|
||||||
@@ -108,19 +107,9 @@ static int Init(void)
|
|||||||
// MOS_Enable(MOS01); // Peltier
|
// MOS_Enable(MOS01); // Peltier
|
||||||
// MOS_Disable(MOS02); // Heating
|
// MOS_Disable(MOS02); // Heating
|
||||||
|
|
||||||
// Only FAN01 and FAN02 are receiving the correct
|
|
||||||
// frequency (25 KHz) right now. The 16-bit timer on
|
|
||||||
// the ATMega32A has two outputs so it would require
|
|
||||||
// software PWM to have a variable frequency on PD7.
|
|
||||||
|
|
||||||
// A simple implementation will take up around 30-50
|
|
||||||
// percent of CPU time. Faster approaches are quite
|
|
||||||
// complicated so it might be worth it to switch to
|
|
||||||
// something like an ATmega328PB.
|
|
||||||
|
|
||||||
PWM_SetValue(FAN01, 50); // Fan Peltier Hot side
|
PWM_SetValue(FAN01, 50); // Fan Peltier Hot side
|
||||||
PWM_SetValue(FAN02, 50); // Fan Peltier Cold Side
|
PWM_SetValue(FAN02, 50); // Fan Peltier Cold Side
|
||||||
// PWM_SetValue(FAN03, 20); // Fan Heating
|
PWM_SetValue(FAN03, 50); // Fan Heating
|
||||||
|
|
||||||
// The I2C_SetChannel command changes the channel
|
// The I2C_SetChannel command changes the channel
|
||||||
// setting of the PCA9546 I2C multiplexer. Any
|
// setting of the PCA9546 I2C multiplexer. Any
|
||||||
|
|||||||
Reference in New Issue
Block a user