QI would like to use the multiprocessor feature of the serial interface of the
ADuC812, in which bit 9 causes an serial interrupt if set. Unfortunately I
can't get this feature working, so I wonder if there is a software error or if
this feature is missing in the ADuC812. Here is my code:
$MOD812 ; use ADuC812 predefined symbols
MOV SCON,#11110000B ; Mode 3, 9 bit, receive enable
MOV TMOD,#20H ; timer 0 no function
; timer 1 mode 2
MOV PCON,#00H ; set SMOD
MOV TH1,#100H-3 ; reload 3 = 11.0592MHz/12/16/2/9600 bd
SETB TR1 ; start timer
SETB ES ; enable serial interrupt
CLR PS ; serial interrupt low priority
SETB EA ; general interrupt enable
JMP LOOP ; repeat indefinately
MOV A,SBUF ; get character
CPL P3.4 ; toggle LED
CLR RI ; clear receive flag
This program should run directly on the evaluation board, it toggles the LED
each time it gets a serial interrupt. Now I send data from my PC with and
without bit9 set, but both cause the interrupt. I ensure the PC program is
correct by looking at the signals with a digital scope.
P.S.: Can I run the ADuC812 with an 11,0592MHZ quartz at 115200 baud?
AThis is a known bug on the ADuC812 and covered in item 3 of the current Errata
sheet (REV E). The full errata sheet is available on our website:
3. UART FUNCTION - MULTIPROCESSOR COMMUNICATIONS MODE :
Background: UART Modes 2 and 3 (programmed via SCON) have a special provision
for multiprocessor communications. In these modes, nine data bits are
received and the ninth bit goes into RB8. In this mode the port can be
programmed so that when the stop bit is received, the serial port interrupt
is activated only if RB8(SCON) = 1. This feature is enabled by setting the
SM2 bit in SCON.
Issue: With SM2 set, the serial port interrupt is set each time a stop bit is
received, regardless of the state of the RB8 bit.
Work-Around : Implement a software polling scheme in the Serial Port ISR so
state of the RB8 bit is checked on entering the ISR. If RB8 is ‘0’ then a
‘RETI’ is executed to exit the ISR immediately, and only if RB8 is set will
the ISR function be executed.
Related Issues : None.