hardware.h File Reference


Detailed Description

Hardware configuration

Author:
Jörgen Birkler (birkler@yahoo.com)
 PD7 [out] BLUE LED (1s alive blink)
 PD6 [in]  ICP; ADXL x-axis (8535:pin20)
 PD5 
 PD4 [out] BUZZER_OUT
 PD3 [in]  INT1. _WAKEUP  (8535:pin17)
 PD2       INT0.  (8535:pin16)
 PD1 [out] UART TXD (8535:pin15)
 PD0 [in]  UART RXD (8535:pin14)

 PC7 [in]  32678 Hz Crystal
 PC6 [out] 32678 Hz Crystal
 PC5 [i/o] I2C Data (8535:pin27) 
 PC4 [i/o] I2C Clk (8535:pin26)
 PC3 [out] LCD_PWR  (8535:pin25)
 PC2 [out] LCD_CHARGE_PUMP2  (8535:pin24)
 PC1 [out] LCD_CHARGE_PUMP1  (8535:pin23)
 PC0 [out] LCD_CHARGE_PUMP0  (8535:pin22)

 PB7 [in]  SCK   (8535:pin8)
 PB6 [out]  MISO   (8535:pin7)
 PB5 [in] MOSI   (8535:pin6)
 PB4       _SS
 PB3 [in]  AIN1;(ADXL Power / 2) (8535:pin4)
 PB2 [in]  AIN0; ADXL y-axis (8535:pin3)
 PB1 [out] ADXL Power (8535:pin2)
 PB0 [out] RED LED (on if CPU clock is on, off is CPU is in power save)

 PA7
 PA6   (8535:pin34)
 PA5
 PA4
 PA3
 PA2 [out] Vref supply  (8535:pin38)
 PA1 [ain] VLCD Meas    (8535:pin39)
 PA0 [ain] Vcc measure  (8535:pin40)

Defines

Typedefs


Define Documentation

 
#define CPU_WAIT  ) 
 

Wait for interupt (oscillator and core is running).

 
#define CPU_POWER_SAVE  ) 
 

Go to powersave. Oscillator and core is stopped. Only Async Timer 2 and Int0/Int1 can wake CPU.

 
#define CPU_IDLE  ) 
 

Go to idle (oscillator is running, core is sleeping).

 
#define CPU_PORTS_INIT  ) 
 

Init all port to input with enabled pull up to avoid current draw at power down.

 
#define CPU_INIT  ) 
 

Init CPU.

#define ADC_LCD_V_LCD _v_meas   ) 
 

                  +-----o Vbatt
                  |
               R1 #     -
                  #       } Vr1
                  |     +
                  +---------o Vmeas
                  |
               R2 #       +-
                  #       |
                  |      ---
         Vlcd o---+      GND

 
 ADC_LCD_V_MEAS = ADC_VBATT + ADC_LCD_V_R1
 ADC_LCD_V_R1 = (ADC_LCD_V_LCD - ADC_VBATT) * (ADC_LCD_R1 / (ADC_LCD_R1 + ADC_LCD_R2))
 =>
 (ADC_LCD_R1 + ADC_LCD_R2) * (ADC_LCD_V_MEAS - ADC_VBATT) = ADC_LCD_R1 * (ADC_LCD_V_LCD - ADC_VREF)
 =>
 ADC_LCD_V_LCD = ((ADC_LCD_R1 + ADC_LCD_R2) * (ADC_LCD_V_MEAS - ADC_VBATT)) / ADC_LCD_R1 + ADC_VBATT

#define UART_WRITE_BYTE _ch   ) 
 

Waits for the transmitter to be ready then outputs the character

 
#define UART_READ_BYTE  ) 
 

Waits until a character becomes available then sets


Typedef Documentation

typedef signed int Voltage_t
 

mV


Copyright 2002 Jörgen Birkler. For accelR8 Accelerometer on Mon Jan 19 21:43:19 2004 by Doxygen 1.3.5.