Thread View: alt.lang.basic
3 messages
3 total messages
Started by Michael Burger
Mon, 25 Jan 1993 23:30
COM3/4 and 14400 BAUD in Quick Basic?
Author: Michael Burger
Date: Mon, 25 Jan 1993 23:30
Date: Mon, 25 Jan 1993 23:30
13 lines
1295 bytes
1295 bytes
The subject line says it all. I need to know if there are any tricks or add ons to have QuickBasic recognize COM3 and COM4 plus transmit in 14400 BAUD. ******************************************************************************* * Mike Burger * The redhead accross the aisle. * * mmb@lamar.colostate.edu * --A student responding to the question * * A Beginning Computing TA Stud * "what will I remember from Beginning * * over 500 students served * Computing after I graduate." * ******************************************************************************* * University of Michigan - 1990 -- Colorado State University - 199? * *******************************************************************************
Re: COM3/4 and 14400 BAUD in Quick Basic?
Author: Ronal Thompson
Date: Tue, 26 Jan 1993 21:12
Date: Tue, 26 Jan 1993 21:12
56 lines
2018 bytes
2018 bytes
mmb@lamar.ColoState.EDU (Michael Burger) writes:
>The subject line says it all. I need to know if there are any tricks or
>add ons to have QuickBasic recognize COM3 and COM4 plus transmit in 14400
>BAUD.
This sub program writes DIRECTLY to the uart.
sets is the speed you want the uart set to.
setp is the port.
you MUST open the port FIRST (usually at 9600) then call this routine
The speec that the uart ACTUALLY gets set to is returned in speed(setp)
this allows you to compare what you want to what you got.
(whatta ya mean I can't set the uart to 113.912 baud?!?!)
SUB BaudSet (sets, setp)
SHARED Speed()
IF setp = 1 THEN offset = &H3F0
IF setp = 2 THEN offset = &H2F0
IF setp = 3 THEN offset = &H3E0
IF setp = 4 THEN offset = &H2E0
Urate = INT(XTAL / (16 * sets))
SPEED.LSB = Urate AND &HFF
IF Urate AND &HFF00 <> 0 THEN
SPEED.MSB = (Urate AND &HFF00) / 256
ELSE
SPEED.MSB = 0
END IF
a = INP(offset + &HB) 'READ DLAB BYTE
a = a OR &H80 'TURN IT ON
OUT (offset + &HB), a 'WRITE IT
OUT (offset + &H8), SPEED.LSB 'LOAD LSB
OUT (offset + &H9), SPEED.MSB 'LOAD MSB
a = a AND &H7F 'TURN DLAB OFF
OUT (offset + &HB), a 'WRITE IT
Speed(setp) = INT(XTAL / (16 * Urate))
END SUB
ronal@telebit.com These ain't no opinions but my own!
R.THOMPSON65 GEnie
MJWG99A Prodigy and remember, what you think of me is none of my business
Re: COM3/4 and 14400 BAUD in Quick Basic?
Author: Ronal Thompson
Date: Wed, 27 Jan 1993 05:58
Date: Wed, 27 Jan 1993 05:58
19 lines
1274 bytes
1274 bytes
>This sub program writes DIRECTLY to the uart. >sets is the speed you want the uart set to. >setp is the port. >you MUST open the port FIRST (usually at 9600) then call this routine >The speec that the uart ACTUALLY gets set to is returned in speed(setp) >this allows you to compare what you want to what you got. >(whatta ya mean I can't set the uart to 113.912 baud?!?!) The constant xtal should be set to 1843200. This is the crystal driving the uart. If you use an external frequency source to vary the uart speed, or to reach normally unobtainable rates, then change this constant accordingly ronal@telebit.com These ain't no opinions but my own! R.THOMPSON65 GEnie MJWG99A Prodigy and remember, what you think of me is none of my business
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads