AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 7

no-image

AN2504

Manufacturer Part Number
AN2504
Description
On-Chip FLASH Programming API for CodeWarrior Software
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
ReadByte
MOTOROLA
On-Chip FLASH Programming API for CodeWarrior Software
If no OSC is defined, the API will assign a frequency of operation equal to four
as the default (OSC = 4).
The ReadByte function receives a byte serially through the communication port
and returns it to the function caller. This routine expects the same non-return-
to-zero (NRZ) communication protocol and baud rate that is used in monitor
mode
ReadByte only receives a character while the monitor routine also re-transmits
each character after it is received.
The communication port is different from one microcontroller to another.
However, function ReadByte automatically uses the communication port for the
microcontroller used.
microcontroller.
1. The baud rate will be f
this routine as well as for the monitor mode send/receive routines have been changed to
accommodate a “standard” f
MC68HC908JB8 is f
2. Frequency of operation — The frequency of operation must be defined.
Freescale Semiconductor, Inc.
Entry Conditions
Exit Conditions
For More Information On This Product,
1
Return Value
Parameters
This is very important because the API functions use it. If this frequency
is defined incorrectly, the API functions won’t work. The frequency of
operation must be defined as the rounded product of four times the
actual internal operating frequency. So, if the internal operating
frequency is 1.2288 MHz, the value defined should be
5 (4 × 1.2288 = 4.9152 ≈ 5). The frequency of operation must be
defined as follows:
#define OSC 5
. The monitor uses a similar routine but unlike the monitor routine,
Prototype
Remarks
Go to: www.freescale.com
OP
OP
/313.
Table 2
/256 for all but the MC68HC908JB8. In this device, the bit rate for
OP
None
None
None
Byte read
The program will enter an infinite loop until a byte is
Communications at the MCU port pin use CMOS logic
received.
levels while a PC serial port requires RS-232 voltage
levels. Therefore, an RS-232 level shifter device such
as the MAX232 is required to interface the MCU to a
PC serial port. Refer to
Communication.
for this device considering it is a USB part. The bit rate for the
Table 5. ReadByte
provides the communication port for each
Byte ReadByte (Void)
Hardware Needed for
FLASH-Programming API
AN2504/D
7

Related parts for AN2504