Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Pulse Accumulator

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Pulse Accumulator - yklein2004 - Nov 16 13:58:04 2006

Hi,

I'm trying to count pulses from wheel encoder. I'm using ICC12 and
MC9S12DP256. The problem I'm having is that the result (PANC1) does
not make any sense. The number are not in sequence.(ex. 179, 254, 18...)
here is my code, Please help.

#include
#include

void initialize(void);

void main(void){
initialize();
while (1){
printf(" %u \r",PACN1);
}
}

void initialize(){
DDRT = 0x00; /* configure all timer port pins for input */
TCTL4 = 0x04;
ICPAR = 0x02; //set PACN1 to count W.E
}



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )