參數(shù)資料
型號: AN2635
廠商: 飛思卡爾半導體(中國)有限公司
英文描述: On-Chip FLASH Programming Routines
中文描述: 片上閃存編程例程
文件頁數(shù): 7/36頁
文件大?。?/td> 150K
代理商: AN2635
How to Use the Routines
On-Chip FLASH Programming Routines, Rev. 4
Freescale Semiconductor
7
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 f
op
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 f
op
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 f
op
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.
相關PDF資料
PDF描述
AN4009 ALARM IC SAMPLE APPLICATIONS
ARP2805D/SF 1-OUTPUT 150 W DC-DC REG PWR SUPPLY MODULE
AS1977-T nPower Single Comp. Open-Drain; Package Type: SOT23-5
AS1976-T nPower,Single Comp. Push-Pull; Package Type: SOT23-5
AT45D161 16-megabit 5-volt Only Serial DataFlash(16M位 5V串行數(shù)據(jù)閃速存儲器)
相關代理商/技術參數(shù)
參數(shù)描述
AN264 制造商:Panasonic Industrial Company 功能描述:IC
AN-264 制造商:AD 制造商全稱:Analog Devices 功能描述:DYNAMIC CHARACTERISTICS OF TRACKING CONVERTERS BY MARK THOMAS
AN2640K 制造商:未知廠家 制造商全稱:未知廠家 功能描述:VHD VIDEO DISC PLAYER CHROMA AND LUMINANCE PROCESSING CIRCUIT
AN2641 制造商:Distributed By MCM 功能描述:USB FILE TRANSFER CABLEPC / MAC 制造商:MCM 功能描述:USB FILE TRANSFER CABLE PC / MAC
AN265 制造商:SILABS 制造商全稱:SILABS 功能描述:2ND-GENERATION PROSLIC㈢ GUI USER’S GUIDE