Tengo unos programas que se que funcionan, pero no me acuwerdo muy bien..
tendrías que revisarlos...
El de Rx (únicamente prende un led si recibe algo por el modulo SCI)
;**************************************************************
;* This stationery is meant to serve as the framework for a *
;* user application. For a more comprehensive program that *
;* demonstrates the more advanced functionality of this *
;* processor, please see the demonstration applications *
;* located in the examples subdirectory of the *
;* Metrowerks Codewarrior for the HC08 Program directory *
;**************************************************************
; export symbols
XDEF Entry, main, RECIBIR
Include 'gp32_registers.inc'
; variable/data section
MY_ZEROPAGE: SECTION SHORT
; Insert here your data definition. For demonstration, temp_byte is used.
temp_byte ds.b 1
; code section
MyCode: SECTION
main:
Entry: RSP
BSR CONFIG_UC
ESPERA: WAIT
JMP ESPERA
RECIBIR: BRCLR 5,SCS1,RECIBIR
LDA SCS1
LDA SCDR
BSET 0,PORTB ;LED DE CONTROL TRANSMISOR
STA PORTA
RTI
/*//**/*/*/*/**/*/*/*/*
El de Tx
;**************************************************************
;* This stationery is meant to serve as the framework for a *
;* user application. For a more comprehensive program that *
;* demonstrates the more advanced functionality of this *
;* processor, please see the demonstration applications *
;* located in the examples subdirectory of the *
;* Metrowerks Codewarrior for the HC08 Program directory *
;**************************************************************
; export symbols
XDEF Entry, main
Include 'gp32_registers.inc'
; variable/data section
MY_ZEROPAGE: SECTION SHORT
; Insert here your data definition. For demonstration, temp_byte is used.
temp_byte ds.b 1
; code section
MyCode: SECTION
main:
Entry: RSP
BSR CONFIG_UC
JMP TRANSMITIR
TRANSMITIR: BRCLR 7,SCS1,TRANSMITIR
LDA SCS1
BSET 0,PORTB ;LED DE CONTROL TRANSMISOR
MOV #0FFH,SCDR
TRANS1 BRCLR 7,SCS1,TRANS1
LDA SCS1
MOV #7FH,SCDR
TRANS2 BRCLR 7,SCS1,TRANS2
LDA SCS1
MOV #40H,SCDR
TRANS3 BRCLR 7,SCS1,TRANS3
LDA SCS1
MOV #20H,SCDR
TRANS4 BRCLR 7,SCS1,TRANS4
MOV #10H,SCDR
TRANS5 BRCLR 7,SCS1,TRANS5
LDA SCS1
MOV #08H,SCDR
TRANS6 BRCLR 7,SCS1,TRANS6
LDA SCS1
MOV #04H,SCDR
TRANS7 BRCLR 7,SCS1,TRANS7
LDA SCS1
MOV #02H,SCDR
JMP TRANSMITIR
CONFIG_UC: CLRA
CLRH
CLRX
MOV #00H,CONFIG2 ;XTAL COMO FUENTE PARA EL SCI
MOV #09H,CONFIG1 ;NO COP, 5V
MOV #0FFH,DDRB ;PUERTO B COMO SALIDA
CLR PORTB ;LIMPIA PUERTO B
BSET 6,SCC1 ;HABILITA EL SCI
BSET 3,SCC2 ;HABILITA EL TRANSMISOR
MOV #34H,SCBR ;300 BAUDIOS XTAL 4M
RTS
BRA Entry ; endless loop
Esto transmite algo, pero no se que palabra es...