00001 /* 00002 ** 00003 **************************************************************************** 00004 ** 00005 ** 00006 ** Copyright (c) 2007 - Atmel Corporation 00007 ** Proprietaty Information 00008 ** 00009 ** Project : ATMEGA88 + ATA6824 High Temperature H-bridge System 00010 ** Module : Hall_sensors.c 00011 ** Description : High temperature DC motor control. 00012 ** To be used with "High temperature H-bridge System" board 00013 ** 00014 ** Version : Date: Author: Comment: 00015 ** 1.0 05.03.2007 F.G. Creation 00016 ** 00017 ** LICENSE - 00018 ** 00019 ** ATMEL - 2007 00020 ** All software programs are provided 'as is' without warranty of any kind: 00021 ** Atmel does not state the suitability of the provided materials for any 00022 ** purpose. Atmel hereby disclaim all warranties and conditions with regard 00023 ** to the provided software, including all implied warranties, fitness for 00024 ** a particular purpose, title and non-infringement.In no event will Atmel 00025 ** be liable for any indirect or consequential damages or any damages 00026 ** whatsoever resulting from the usage of the software program. 00027 **************************************************************************** 00028 ** 00029 */ 00030 00031 00032 /*_____ I N C L U D E S ____________________________________________________*/ 00033 #include "config.h" 00034 #include "Hall_sensors.h" 00035 00036 /*_____ M A C R O S ________________________________________________________*/ 00037 /*_____ D E F I N I T I O N S ______________________________________________*/ 00038 /*_____ P R O T O T Y P E S - D E C L A R A T I O N ________________________*/ 00039 /*_____ G L O B A L S ______________________________________________________*/ 00040 00041 00042 00043 00050 void Hall_sensors_ISR_init(void) 00051 { 00052 /*init PCINT0 Pin change interrupt initialisation */ 00053 // PCINT7...0 interrupt pins enabled 00054 PCICR |= 1 << PCIE0; 00055 // PCINT7/6 interrupt pin are enabled 00056 PCMSK0 |= (1 << PCINT7) | (1 << PCINT6); 00057 } 00058 00059 00060 00065 #if defined(__ICCAVR__) //IAR COMPILER USED 00066 #pragma vector= PCINT0_vect //Pin Change interrupt 0 vector for ATmega88 00067 __interrupt void hall_sensor_1_2_ISR (void) 00068 #elif defined (__AVR__) // Avr-gcc compiler used 00069 ISR(PCINT0_vect) 00070 #endif 00071 { 00072 /* PLACE NECESSARY CODE HERE 00073 * IF OPTIONNAL HALL SENSOR(S) 00074 * ARE AVAILABLE 00075 * to compute position/speed 00076 * for example. 00077 */ 00078 }
1.4.7