tmp89fm42l TOSHIBA Semiconductor CORPORATION, tmp89fm42l Datasheet - Page 358

no-image

tmp89fm42l

Manufacturer Part Number
tmp89fm42l
Description
8 Bit Microcontroller Tlcs-870/c1 Series
Manufacturer
TOSHIBA Semiconductor CORPORATION
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
tmp89fm42lUG
Manufacturer:
ST
Quantity:
500
Part Number:
tmp89fm42lUG
Manufacturer:
TOSHIBA
Quantity:
745
Part Number:
tmp89fm42lUG
Manufacturer:
TOSHIBA
Quantity:
1 000
Part Number:
tmp89fm42lUG
Manufacturer:
TOSHIBA/东芝
Quantity:
20 000
21.6
API (Application Programming Interface)
RA006
21.6.6
8 bits data (0x80) of UART is captured by 16-bit timer counter which is set to pulse width measurement mode.
In this case, the timer counter input pin should be assigned to RXD pin. And stores the captured value in WA
register. Be sure to select fcgck/2 as the source clock for 16-bit timer counter and capture the length of 8 bits. C
register should be written 0x08.
SEL<TCA0SEL> temporarily. After capturing, be sure to resume the pin to RXD pin.
bits 5, 4 and 3 are suitable value for UARTCR2<RTSEL> and the return value of A register is a suitable data for
UARTDR. The API sets bits 7, 6, 2, 1 and 0 to "0" as return value. Therefore, set the proper value for
UARTCR2<RXDNC, STOPBR>. If the contents of WA register is out of the area 0x0020 to 0x3BFF, the API
returns WA register with 0xFFFF as return value.
support program.
Note 1: If the captured value of WA register is little even though the value is within 0x0020 to 0x3BFF, the proper
Note 1: If general-purpose registers (WA, BC, DE, IX, IY) are used in non-maskable interrupt subroutine, occurring
Note 2: With success of calculation, this API returns "0" into bits 7, 6, 2, 1 and 0 as return value. Therefore, set proper
This API calculates the proper setting for baud rate of UART from the value of C and WA register. Generally,
RXD pin can be used as TCA pin. To capture the value, please select the pin as TCA pin by SER-
The possible value for WA register as argument is from 0x0020 to 0x3BFF. In the return value of WA register,
The following procedure shows example how to calculate the baud rate for UART in MCU mode by using
.BTCalcUART
1. By serial interface selection control register SERSEL<TCA0SEL>, assign TCA pin to RXD pin.
2. Set 16-bit timer counter to pulse width measurement mode. And set falling edge/L level as an external
3. Receive data (0x80) via RXD pin and capture it by 16-bit timer counter. In this case, enabling of UART
4. Write the captured value into WA register. Because general-purpose registers (DE, BC, IX, IY) are
5. Set the interrupt master enable flag to "disable (DI)" (IMF ← "0").
6. Set "0xD5" on FLSCR2<CR1EN> after setting FLSCR1<BAREA> to "1".
7. Set "0x08" to C register as the number of bit.
8. Call address (0x101E).
9. Set bits 5, 4 and 3 of W register into UARTCR2<RTSEL> and set the contents of A register to
10. Set "0xD5" to FLSCR2 after setting FLSCR1<BAREA> to "0".
setting may not be gotten.
trigger and select fcgck/2 as the source clock.
is no need.
rewritten in the support program, the contents of these registers should be saved before calling the
support program.
UARTDR. If the value of WA register is 0xFFFF which indicates an error of calculation, retry the
execution from receiving data (0x80).
of non-maskable interrupt may cause unexpected result.
value for these bits to set UART0CR2<RXDNC> and UART0CR2<STOPBR>.
Page 344
TMP89FM42L

Related parts for tmp89fm42l