hi, i'm a student in South, Korea and studying freescale with MC9s12XEP100,
actually, i would like to know how to use timer/counter in xep100 board.. i'm used to using atmega128, however, there's a few diffrence btw this..and that..
In atmega128 case, i do set some register (TCCR, TCNT, TIFR, TIMSK) to use timer/counter.. but i don't know what register goes to replace them (atmega128 register for counter)
basically i couldn't find any materials which described about xep100 info.. so that i finally wrote this contents.. to know...
plz let me know.. some details.. which register can i use for it.. i will really appreciate if i know about precious information...
thanks.. le03169@gmail.com
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include "MC9S12XEP100.h"
#include "derivative.h"
volatile unsigned int Timer_Count;
#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt 85 void Velocity(void) {
PORTA_PA1 = 1;
Timer_Count --;
if(Timer_Count == 0)
PORTA_PA1 = 1;
PITTF = 0x01;
}
void Platforminit(void) {
PITCFLMT = 0; // disable PIT
PITCE = 0x01;
PITMUX = 0x01;
PITMTLD0 = 0x63;
PITLD0 = 0x0004;
PITINTE = 0x01;
PITCFLMT = 0x80;
}
void main(void) {
DDRA = 0x0F;
Timer_Count = 10;
Platforminit();
while(1);
}
this is the source that i made...
if u r able to fix it, plz do that... i will be very thank for it...