[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read full 8-bit character from serial port?



schmidtd <schmidtd@my-deja.com> wrote:

> Jorge Chamorro Bieling wrote:
> 
> > There's no SCC setup here, and you should first set it up (the 8530) by
> > other means. For example via an IN#2 or whatever.
> 
> Is there a reference anywhere on how to set up communications
> parameters (baud rate, etc.) from assembly?  I.e. I imagine there's
> some ports we twiddle... any ideas where they're documented?

They are documented in the 8530 scc user's manual.

The baud rate generator's time constant is set in write registers 12 and
13. It can be read in read registers 12 and 13:

SCC_A_CMD  EQU  $C039   //scc CHANNEL A
SCC_A_DATA EQU  $C03B
SCC_B_CMD  EQU  $C038   //scc CHANNEL B
SCC_B_DATA EQU  $C03A

        LDA SCC_A_CMD   //DUMMY READ
        LDA #$0c
        STA SCC_A_CMD   //set ptr to rr12
        LDA SCC_A_DATA  //read rr12
        STA TIME_CONSTANT_LSB

        LDA #$0d
        STA SCC_A_CMD   //set ptr to rr13
        LDA SCC_A_DATA  //read rr13
        STA TIME_CONSTANT_MSB

If you tell me what these values are for a certain baud rate, I can try
to guess how the other (baud rate config) registers of the scc are
setup, and what you could do in order to get other baud rates.

-- 
Jorge Chamorro Bieling