UPD78F0078GK-9ET-A Renesas Electronics America, UPD78F0078GK-9ET-A Datasheet - Page 180

no-image

UPD78F0078GK-9ET-A

Manufacturer Part Number
UPD78F0078GK-9ET-A
Description
Manufacturer
Renesas Electronics America
Datasheet

Specifications of UPD78F0078GK-9ET-A

Lead Free Status / Rohs Status
Supplier Unconfirmed

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
UPD78F0078GK-9ET-A
Quantity:
57
8.5.2 Pulse width measurement by free-running counter and one capture register
/******************************************************************************/
/*
/*
/*
/*
/*
/*
/*
/*
/******************************************************************************/
#pragma sfr
#pragma EI
#pragma DI
#pragma interrupt INTTM010 intervalint rb2
void main(void)
{
}
/* Timer 00 interrupt function */
void intervalint()
{
/*****************************************************/
/*
/* Define variables required for interrupt here
/*
/*****************************************************/
/***********************************************************/
/*
/* Describe processing required for interrupt below
/*
/***********************************************************/
}
178
unsigned int data[3];
unsigned int length;
PCC = 0x0;
data[0] = 0;
data[1] = 0;
data[2] = 0;
PM7.0 = 1;
TMMK010 = 0;
PRM00 = 0b00110010;
CRC00 = 0b00000100;
TMC00 = 0b00000100;
EI();
while(1){
}
unsigned int work;
work = CR010;
data[1] = work - data[2];
data[2] = work;
data[0] = 0xffff;
Pulse width measurement example by free-running and CR010
Measurement results to be up to 16 bits and not checked for errors
data[0]: End flag
data[1]: Measurement results (pulse width)
data[2]: Previous read value
Timer 00 operation sample
while(data[0] == 0);
DI();
length = data[1];
data[0] = 0;
EI();
CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01
User’s Manual U14260EJ4V0UD
/* Data area */
/* Set high-speed operation mode */
/* Set port */
/* Set P70 as input */
/* Set interrupt */
/* Cancel INTTM010 interrupt mask */
/* Set timer 00 */
/* Both rising and falling edges for TI000 */
/* Count clock is fx/2^6
/* Set CR010 to capture register */
/* Start in free-run mode */
/* Dummy loop */
/* Wait for measurement completion */
/* Disable interrupt for exclusive operation */
/* Read measurement results */
/* Clear end flag */
/* Exclusive operation completed */
/* Read capture value */
/* Calculate and update interval */
/* Update read value */
/* Set measurement completion flag*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Related parts for UPD78F0078GK-9ET-A