DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

MC68HC908LB8_05 データシートの表示(PDF) - Freescale Semiconductor

部品番号
コンポーネント説明
メーカー
MC68HC908LB8_05
Freescale
Freescale Semiconductor Freescale
MC68HC908LB8_05 Datasheet PDF : 36 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
How to Use the Routines
GetByte
GetByte is a routine that receives a byte on the general-purpose I/O PTA0, and the received value is
returned to the calling routine in the accumulator (A). This routine is also used in monitor mode so that it
expects the same non-return-to-zero (NRZ) communication protocol and baud rates.
This routine detects a framing error when a STOP bit is not detected. If the carry (C) bit of the condition
control register (CCR) is cleared after returning from this routine, a framing error occurred during the data
receiving process. Therefore, the data in A is not reliable. The user software is responsible for handling
such errors.
Interrupts are not masked (the I bit is not set) and the COP is not serviced in the GetByte routine. User
software should ensure that interrupts are blocked during character reception.
To provide a specific communication baud rate, GetByte calls the GetBit subroutine. In the GetByte
routine, two different clock sources, internal clock and external clock, are supported. For example, the
MC68HC908LB8 usually has a trimmed internal bus clock of 4 MHz and an external bus clock of
2.4576 MHz. For the MCU to distinguish which clock source is currently selected, the ECGST (external
clock generator status) bit in the OSCSTAT (oscillator status register) is monitored in the GetBit
subroutine. When ECGST bit is set, the external clock is selected as a clock source. When the bit is
cleared, the internal clock is selected.
The baud rate is defined by fop divided by a constant value, which is specified in the development support
section in the device data sheet. In the case of the MC68HC908LB8, the baud rate of an internal clock
source is defined by fop divided by 417. If the internal bus clock is 4 MHz, the baud rate is
4 MHz/417 = 9592. Therefore, the closest PC baud rate is 9600. On the other hand, the baud rate of an
external clock source is fop divided by 256. When an external bus clock is 2.4576 MHz, the baud rate is
2.4576 MHz/256 = 9600.
To use this routine, some hardware setup is required. The general-purpose I/O PTA0 must be pulled up.
For more information, refer to the development support section in the device data sheet.
Entry Condition
PTA0 — This pin must be configured as an input and pulled up in hardware.
Exit Condition
A — Contains data received from PTA0.
C bit — Usually the C bit is set, indicating proper reception of the STOP bit. However, if the C bit is clear,
a framing error occurred. Therefore, the received byte in A is not reliable.
On-Chip FLASH Programming Routines, Rev. 4
Freescale Semiconductor
7

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]