Article View: alt.lang.basic
Article #449Re: COM3/4 and 14400 BAUD in Quick Basic?
From: 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
Technical Details
Message-ID:
<C1HC87.8rL@telebit.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!nntp.telebit.com!ronalReferences:
<Jan25.233042.68887@yuma.ACNS.ColoState.EDU>Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.basic Path: arc1-ca.pugleaf.net!sparky!uunet!nntp.telebit.com!ronal From: ronal@telebit.com (Ronal Thompson) Subject: Re: COM3/4 and 14400 BAUD in Quick Basic? Message-ID: <C1HC87.8rL@telebit.com> Sender: news@telebit.com Nntp-Posting-Host: dolphin Organization: Telebit Corporation; Sunnyvale, CA, USA References: <Jan25.233042.68887@yuma.ACNS.ColoState.EDU> Date: Tue, 26 Jan 1993 21:12:07 GMT Lines: 56