Hi,
The most probably there is a problem with the MCU pin which is connected to /FORCEOFF pin of MAX3387E transciever. The MCU pin is floating, so the transciever gets on and off randomly.
The solution can be to hardwire the /FORCEOFF pin to VDD.
Other solution can be to modify the StartS12.s file located in Sources folder of the Bootloader_S12 application SW.
The MCU pin PAD15 should be set as digital output by write to DDR0AD register and then set high level at the pin by write to PTA0AD register:
This is how it should look like:
; TWR-S12G128 - pin PAD07 - pushbutton SW4
movb #$80, $0274 ; pin PAD15 as digital output (DDR0AD register) for drive FORCEOFF* signal at RS232 transceiver
movb #$80, $0270 ; set hi level at pin PAD15 (PT0AD register) for enable RS232 transceiver
movb #$80, $0279 ; enable pull up resistor on pin PAD07 (button SW4)
movb #$80, $007D ; enable digital input buffer on pin PAD07 (button SW4)
nop ;wait a few cycles for stabilization of the signal
nop
nop
nop
nop
brclr $0273, $80, GoBoot ; if PAD07 == 0 then start the bootloader
; if PAD07 == 1 then start the application
movb #$00, $007D ; disable digital input buffer on pin PAD07
movb #$00, $0279 ; disable pull up resistor on pin PAD07 - restore default state
; keep the PAD15 high
; ---------------------------------------------------------------------------------
Hope that helps.
Regards,
iggi