Help on SCI coding in HC11

D

devwk

Guest
Hi,

My name is Albert, now doing my project in my university. Currently
doing the project of receiving and transmiting data from fpga to pc by
using the hc11. In the project i need to
1 - get the data from pc through rs-232 port. The pc part is done by
my team mate. She using the Visual Basic to transmit a set of data .
2 - the data then is receive by the hc11 and output the data to port
B. The data need to be in 8 bits binary number.
3 - after the fpga process the data the hc11 need to get the data and
then send back to the to the pc and the data from fpga also in 8 bits
binary number.

Now i have the problem with this code can anyone help on this?
BAUD EQU $2B
SCCR1 EQU $2C
SCCR2 EQU $2D
SCDR EQU $2F
RDRF EQU $20
SCSR EQU $2E
PORTB EQU $04

ORG $00
ONSCI LDX #$1000
LDAA #$30
STAA BAUD,X
LDAA #$00
STAA SCCR1,X
LDAA #$0C
STAA SCCR2,X

SCIgetch LDX #$1000
BRCLR SCSR,X RDRF SCIgetch
LDAA SCDR,X
STAA PORTB,X
RTS

ORG $fffe ;define the reset vector to point to
FDB ONSCI ; the beginning of your code

**** there are few question i want to ask??
1. When i test this program using the simulator( THrsim11 ) i get the
result what i get is in ASCII code. Is there anyway i can save the
data in binary.
2. Then i try to download to the M68HC11 EVB, i cannot download to it
because having error.

Because i need to get the data first so i need to get the reveiver
code done before I can test the transmit and join it. I hope someone
can help me...

Thanks for it...
 
devwk <wkyook@hotmail.com> wrote in message
news:ce51071d.0403261731.36df2c82@posting.google.com...
Hi,

My name is Albert, now doing my project in my university. Currently
doing the project of receiving and transmiting data from fpga to pc by
using the hc11. In the project i need to
1 - get the data from pc through rs-232 port. The pc part is done by
my team mate. She using the Visual Basic to transmit a set of data .
2 - the data then is receive by the hc11 and output the data to port
B. The data need to be in 8 bits binary number.
3 - after the fpga process the data the hc11 need to get the data and
then send back to the to the pc and the data from fpga also in 8 bits
binary number.

Now i have the problem with this code can anyone help on this?
BAUD EQU $2B
SCCR1 EQU $2C
SCCR2 EQU $2D
SCDR EQU $2F
RDRF EQU $20
SCSR EQU $2E
PORTB EQU $04

ORG $00
ONSCI LDX #$1000
LDAA #$30
STAA BAUD,X
LDAA #$00
STAA SCCR1,X
LDAA #$0C
STAA SCCR2,X

SCIgetch LDX #$1000
BRCLR SCSR,X RDRF SCIgetch
LDAA SCDR,X
STAA PORTB,X
RTS

ORG $fffe ;define the reset vector to point to
FDB ONSCI ; the beginning of your code

**** there are few question i want to ask??
1. When i test this program using the simulator( THrsim11 ) i get the
result what i get is in ASCII code. Is there anyway i can save the
data in binary.
2. Then i try to download to the M68HC11 EVB, i cannot download to it
because having error.

Because i need to get the data first so i need to get the reveiver
code done before I can test the transmit and join it. I hope someone
can help me...

Thanks for it...
I can't assist with your development environment as I use my own. I have
code the same as yours that works, except that the initialisation includes a
statement that sets bit 20H in SPCR. This disables the pullup on the RxD
pin.
 

Welcome to EDABoard.com

Sponsor

Back
Top