haxmark/src/config.h
fruchti 8ac4d886e5 Adjust timing to 1200dpi
At first I was using the 2400dpi mode of the printer. I now switched to
the native resolution of 1200dpi because the results are way better. The
2400dpi mode can still be used if a #define in config.h is changed.
2015-09-20 19:36:26 +02:00

83 lines
3 KiB
C

// -fruchti 2015
#ifndef CONFIG_H_
#define CONFIG_H_
#define F_CPU 8000000
#include <avr/io.h>
#include <avr/interrupt.h>
// Printer settings
#define PRINTRES 1200 // Resolution, either 1200 or 2400 (dpi)
// All delay times are measured in milliseconds
#define T_HALL_L 6 // Hall sensor timeout. After this time
// is elapsed without a pin change, the
// motor is considered stopped
#define T_POWRON 5000 // Delay to allow printer to start up
#if PRINTRES == 1200 // Printer set to 1200dpi
#define T_CLUTCH 3559 // Delay between starting print job and
// pulling in carrier/activating manual
// paper feed sensor
#define T_EXIT_H 1666 // Delay between activation of paper in
// and activation of exit sensor
#define T_MNPF_L 419 // Delay before deactivation of manual
// paper feed sensor after exit sensor
// is activated
#define T_PPIN_L 630 // Delay before deactivation of paper
// in sensor
#define T_EXIT_L 1689 // Delay before deactivation of exit
// sensor
#else // Timing for 2400dpi image resolution
#define T_CLUTCH 3406
#define T_EXIT_H 841
#define T_MNPF_L 213
#define T_PPIN_L 311
#define T_EXIT_L 849
#endif
#define D_LED_RD DDRD // Red status LED
#define O_LED_RD PORTD
#define P_LED_RD PD6
#define D_LED_YE DDRD // Yellow status LED
#define O_LED_YE PORTD
#define P_LED_YE PD5
#define D_LED_GN DDRD // Green status LED
#define O_LED_GN PORTD
#define P_LED_GN PD4
#define I_NPPINS PINB // New paper in sensor
#define O_NPPINS PORTB
#define P_NPPINS PB0
#define D_PPINSO DDRB // Paper in sensor output
#define O_PPINSO PORTB
#define P_PPINSO PB1
#define D_MNPFSO DDRB // Manual paper feed sensor output
#define O_MNPFSO PORTB
#define P_MNPFSO PB2
#define D_EXITSO DDRB // Exit sensor output
#define O_EXITSO PORTB
#define P_EXITSO PB3
#define D_CLUTCH DDRB // Clutch control pin
#define O_CLUTCH PORTB
#define P_CLUTCH PB4
#define I_OPANEL PIND // Operator panel
#define P_OPANEL PD2 // CAUTION: Do not change (INT0 is used
// for monitoring this input)!
#define I_HALL_1 PIND // Hall sensor from motor
#define P_HALL_1 PD3
#endif