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

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.4 Pulse width measurement by restart
/**************************************************************************/
/*
/*
/*
/*
/*
/*
/*
/*
/**************************************************************************/
#pragma sfr
#pragma EI
#pragma DI
#pragma interrupt INTTM010 intervalint rb2
void main(void)
{
}
/* Timer00 interrupt function */
void intervalint()
{
/******************************************************/
/*
/* Define variables required for interrupt here
/*
/******************************************************/
/********************************************************/
/*
/* Describe processing required for interrupt below
/*
/********************************************************/
}
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 = 0b00001000;
EI();
while(1){
}
data[2] = data[1];
data[1] = CR010;
data[0] = 0xffff;
Pulse width measurement example by restart
Measurement results up to 16 bits, not to be checked for errors
data[0]: End flag
data[1]: Measurement results (pulse width)
data[2]: Previous read value
Timer 00 operation sample
if(data[0] != 0)
{
}
CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01
TMMK010 = 1;
length = data[1]+data[2];
data[0] = 0;
TMMK010 = 0;
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
/* Count clock is fx/2^6
/* Set CR010 to capture register
/* Clear & start at TI000 valid edge */
/* Dummy loop */
/* Wait for TI000 measurement completion */
/* Update old data */
/* Update read value */
/* Set measurement completion flag*/
/* Disable INTTM010 for exclusive
/* Clear end flag */
/* Exclusive operation completed */
operation */
*/
*/
*/
/* Cycle calculation based on
*/
*/
*/
measurement results */
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
181

Related parts for UPD78F0078GK-9ET-A