Main Page | File List | Globals | Related Pages

t2313_softpwm.h

Go to the documentation of this file.
00001 // This file has been prepared for Doxygen automatic documentation generation.
00023 #define DEBUG 0
00024 
00026 #if defined(__ICCAVR__)
00027   // correct an IAR definition for Watchdog Timer Control Register,
00028   // may not be needed in later versions of IAR or for other AVR devices.
00029   #define WDTCSR  WDTCR
00030 #elif __GNUC__ > 0
00031   // redefine some macros
00032   #define __C_task int
00033   #define __enable_interrupt()  sei()
00034   #define __watchdog_reset()    wdt_reset()
00035 #endif
00036 
00038 #define CHMAX       10    // maximum number of PWM channels
00039 #define PWMDEFAULT  0x80  // default PWM value at start up for all channels
00040 
00041 #define CH0_CLEAR (pinlevelD &= ~(1 << PD2)) // map CH0 to PD2
00042 #define CH1_CLEAR (pinlevelD &= ~(1 << PD3)) // map CH1 to PD3
00043 #define CH2_CLEAR (pinlevelD &= ~(1 << PD4)) // map CH2 to PD4
00044 #define CH3_CLEAR (pinlevelD &= ~(1 << PD5)) // map CH3 to PD5
00045 #define CH4_CLEAR (pinlevelD &= ~(1 << PD6)) // map CH4 to PD6
00046 
00047 #define CH5_CLEAR (pinlevelB &= ~(1 << PB0)) // map CH5 to PB0
00048 #define CH6_CLEAR (pinlevelB &= ~(1 << PB1)) // map CH6 to PB1
00049 #define CH7_CLEAR (pinlevelB &= ~(1 << PB2)) // map CH7 to PB2
00050 #define CH8_CLEAR (pinlevelB &= ~(1 << PB3)) // map CH8 to PB3
00051 #define CH9_CLEAR (pinlevelB &= ~(1 << PB4)) // map CH9 to PB4
00052 
00054 #define PORTB_MASK  (1 << PB0)|(1 << PB1)|(1 << PB2)|(1 << PB3)|(1 << PB4)
00055 #define PORTD_MASK  (1 << PD2)|(1 << PD3)|(1 << PD4)|(1 << PD5)|(1 << PD6)
00056 
00057 #define DEBUGPIN_ON   PORTB |= (1 << PB7)
00058 #define DEBUGPIN_OFF  PORTB &= ~(1 << PB7)
00059 #define DEBUGSET      DDRB |= (1 << DDB7)
00060 
00062 void Init(void);
00063 void USART0_Init( unsigned int baudrate );
00064 unsigned char USART0_Receive( void );
00065 void USART0_Transmit( unsigned char data );
00066 unsigned char HexToASCII (unsigned char ch);
00067 unsigned char GetNextChar(void);
00068 void ManualControl(void);
00069 void DebugMonitor(void);

Generated on Tue Dec 20 15:11:31 2005 for AVR136: Low-Jitter Multi-Channel Software PWM by  doxygen 1.4.4