2015-05-05 18:49:42 +02:00
|
|
|
// -fruchti 2015
|
|
|
|
|
|
|
|
#ifndef CONFIG_H_
|
|
|
|
#define CONFIG_H_
|
|
|
|
|
|
|
|
#define F_CPU 8000000
|
|
|
|
|
|
|
|
#include <avr/io.h>
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
2015-09-20 19:36:26 +02:00
|
|
|
// Printer settings
|
|
|
|
#define PRINTRES 1200 // Resolution, either 1200 or 2400 (dpi)
|
|
|
|
|
2015-05-05 18:49:42 +02:00
|
|
|
// 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
|
|
|
|
|
2015-09-20 19:36:26 +02:00
|
|
|
#if PRINTRES == 1200 // Printer set to 1200dpi
|
|
|
|
|
|
|
|
#define T_CLUTCH 3559 // Delay between starting print job and
|
2015-05-05 18:49:42 +02:00
|
|
|
// pulling in carrier/activating manual
|
|
|
|
// paper feed sensor
|
2015-09-20 19:36:26 +02:00
|
|
|
#define T_EXIT_H 1666 // Delay between activation of paper in
|
2015-05-05 18:49:42 +02:00
|
|
|
// and activation of exit sensor
|
2015-09-20 19:36:26 +02:00
|
|
|
#define T_MNPF_L 419 // Delay before deactivation of manual
|
2015-05-05 18:49:42 +02:00
|
|
|
// paper feed sensor after exit sensor
|
|
|
|
// is activated
|
2015-09-20 19:36:26 +02:00
|
|
|
#define T_PPIN_L 630 // Delay before deactivation of paper
|
2015-05-05 18:49:42 +02:00
|
|
|
// in sensor
|
2015-09-20 19:36:26 +02:00
|
|
|
#define T_EXIT_L 1689 // Delay before deactivation of exit
|
2015-05-05 18:49:42 +02:00
|
|
|
// sensor
|
|
|
|
|
2015-09-20 19:36:26 +02:00
|
|
|
#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
|
|
|
|
|
2015-05-05 18:49:42 +02:00
|
|
|
#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
|