![]() ![]()
Bits C4 and C5 designate internal(no pin) software enabled control port register bitsĭECLARE DYNAMIC LIBRARY 'inpout32' FUNCTION Inp32% ( BYVAL PortAddress AS INTEGER) SUB Out32 ( BYVAL PortAddress AS INTEGER, BYVAL Value AS INTEGER) END DECLAREBaseadd% = &H3F8 'any valid COM port address (see the Windows Hardware COM port Properties)Out32 Baseadd% + 3, &H80 'set Divisor Latch Access Bit using 128 Hex (LCR) 'Out32 Baseadd%, &H60 ' 1200 baud 96 Write DL Low Byte 'Out32 Baseadd%, &H30 ' 2400 48 'Out32 Baseadd%, &H18 ' 4800 24Out32 Baseadd%, &HC ' 9600 12 Maximum baud rate in QB!Out32 Baseadd% + 1, &H0 'Write DL High Byte 'Set Base and IER back to normal registers, and set Data requirementsOut32 Baseadd% + 3, &H3 'set 8 bit word(bit0 + bit1=3), 1 Stop Bit(0ff), No Parity(0ff) 'COM should now be set as N, 8, 1 by the LCR. Red pin numbers are inverted so that bits on set corresponding output pins low and bits off set pins high.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |