ATA6824_defs.c File Reference

#include "config.h"
#include "ATA6824_defs.h"
#include "Timer0_PWM.h"

Include dependency graph for ATA6824_defs.c:

Go to the source code of this file.

Functions

void refresh_ATA6824_watchdog (void)
 refresh_watchdog Refreshes the ATA6824 external watchdog according to its required refresh period (fixed by an external resistor).
void Diag_inputs_ISR_init (void)
 Diag_inputs_ISR_init set-up Pin change interrupts on diagnotics inputs
  • Enable PCINT14 to 8 mask
  • Configure DG1, DG2 and DG3 resp. PCINT10, PCINT11 and PCINT12 to generate interrupts on both rising or falling edges.


Variables

ATA6824_diag_mgt_t ATA6824_diag_mgt


Function Documentation

void refresh_ATA6824_watchdog ( void   ) 

refresh_watchdog Refreshes the ATA6824 external watchdog according to its required refresh period (fixed by an external resistor).

This routine uses the software time base to generate rising edges on the WD trigger pin of the ATA6824 during the open window t2 (see datasheet).

Warning:
: changing Timer 0 overflow period will affect the time base and so the watchdog refresh period.

Definition at line 56 of file ATA6824_defs.c.

References SoftTimer_t::count, ONE_SECOND, time_count_1s, and WD_TIME_TRIG.

Referenced by main().

00057 {
00058   static unsigned int last_count=0;     // remembers the last WD trigger instant
00059   signed int dif;                   
00060   
00061   // Compute elapsed time since the last WD trigger has occured
00062   dif = last_count - (U16)(time_count_1s.count);
00063   
00064   if (dif<0) 
00065     {dif = dif + ONE_SECOND; };         // take care of time count overflows
00066   
00067   // Check the elapsed time since the last WD trigger
00068   if (dif > WD_TIME_TRIG)
00069   {
00070     // Toggle the Watchdog trigger pin when half of the period has elapsed
00071     TOGGLE_WD_TRIG();                     
00072     last_count = time_count_1s.count;   // remember the last WD trigger instant
00073   }
00074 }

void Diag_inputs_ISR_init ( void   ) 

Diag_inputs_ISR_init set-up Pin change interrupts on diagnotics inputs

Definition at line 83 of file ATA6824_defs.c.

Referenced by main().

00084 {
00085     /*init PCINT1  Pin change interrupt initialisation */
00086     // PCINT14...8 interrupt pins enabled
00087   PCICR |= 1 << PCIE1;   
00088     // PCINT10/11/12 interrupt pin are enabled    
00089   PCMSK1 |= (1 << PCINT12) | (1 << PCINT11) | (1 << PCINT10);  
00090 }


Variable Documentation

ATA6824_diag_mgt_t ATA6824_diag_mgt

Definition at line 43 of file ATA6824_defs.c.

Referenced by display_defaults().


Generated on Wed Mar 14 10:53:33 2007 for Mega88_&_ATA6824_High_temperature_H-Bridge_system by  doxygen 1.4.7