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

68HC05K0 查看數據表(PDF) - Motorola => Freescale

零件编号
产品描述 (功能)
生产厂家
68HC05K0
Motorola
Motorola => Freescale 
68HC05K0 Datasheet PDF : 12 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
Software
The listing of the remote control assembler code is
contained at the end of this application note. The
first section of the listing sets up the ports prior to
going into STOP mode and waiting for a key to be
pressed. PortA bits 0-3 are set up as inputs with the
pull-downs enabled. Bits 4-7 are set up as outputs
logic ‘1’ as is PortB bit 0. PortB bit 1 is set-up as
output logic ‘0’ to switch off the IR amplifier before
going into STOP mode.
The next section of code named ‘presd’ is the
routine pointed to by the interrupt vector and is
entered when a key is pressed. This routine first
calls the keyboard scanning routine to determine
which key has been pressed. It then calls the
decoding routine to convert the code from the
keyboard to a code that will be accepted by the
television. The start message is then transmitted
and is followed by the instruction message. There
is then a check to see if the same key is still being
pressed. If it is then the instruction message is
re-transmitted until the key is released and the end
message is transmitted.
As the transmission protocol requires nine data bits
and only one byte instructions are being decoded a
flag has to be set for the ninth bit of the
transmission routine. For the start and end
transmissions this flag is set to 1 to give the nine
1’s message. For all instructions the ninth bit is 0 so
the flag is cleared.
The decoding routine compares the code from the
keyboard scan routine with data array ‘keydat’. On
a match it takes the corresponding element from
the array ‘tvdat’ as the instruction code for
transmission.
The values of the instruction codes shown in the
right-hand side of Figure 1 are specific for the
receiver application. Each receiver using the same
communications protocol will receive the same
nine bit instruction but what the instruction does is
dependent upon the receiver software. In this
example the eight bit instruction ‘14’ changes the
channel to number four. In another receiver
application the receiver may interpret the
instruction code ‘14’ as increase volume.
The transmission routine is entered with the
instruction for transmission in ‘keyst3’. After the
pre-bit and the start-bit are transmitted the
instruction byte is rotated (LSB first) into the carry
flag. A logic ‘1’ is sent for transmission if the flag is
set after rotation and a logic ‘0’ is sent for
transmission if the flag is cleared. Each bit is
transmitted as shown in Figure 1. The routines
‘send0’ and ‘send1’ send a pause of 512µs
followed by a 32kHz pulse train for 512µs and a
32kHz pulse train for 512µs followed by a 512µs
pause respectively. In the situation when a ‘1’
follows a ‘0’ then a pulse train of 1024µs is
required. To avoid breaks in this pulse train the
‘send0’ routine checks the next bit to be
transmitted to see if a double length pulse train
must be transmitted. The ‘send1’ routine then has
to check that a double length pulse train has not
been sent in the previous one and a half bit periods
before sending a pulse train.
The routine ‘burst’ produces the 32kHz pulse train for
a duration set by a count in the accumulator. As the
instruction time for setting the PortB bit 1 pin high or
low is five clock cycles then the minimum processor
clock period is derived by dividing the minimum
output state time, which is 8µs when the output is
high, by the minimum number of clock cycles to
change this state. This gives an internal clock period
of 8µs/5 equalling 1.6µs. Adding a three cycle delay
will require an internal clock period of 8µs/8 = 1µs,
allowing a 2MHz oscillator to be used.
The code size is approximately 300 bytes, leaving
memory space for more features to be added to the
controller.
MOTOROLA
6
AN463/D

Share Link: 

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