It manages an additional Asynchronous serial line, with Interrupts. The SW serial line is managed through the high level instructions of BASCOM, joined with Interrupt, in order to become not suspensive, or in other words, they doesn't stop program execution during Transmission and Reception of characters. Communication doesn't suspend program execution and it is managed with BASCOM 8051 instructions plus Interrupt. Ex054.HEX. Through the serial communication line, in RS 232, it is driven the status of Relays. Chapter.037 - CENTRONICS Port and Parallel Port LPT.
>>> [email protected] 07/11/01 12:32AM >>> Hi, The serial buffered input/output is inteded for the hardware uart. When you use INPUT,INKEY or WAITKEY you are doing serial input. Normally this returns info from the serial port. But what happens if you are in an interrupt or performing a time consuming function? The hardware uart can only store 1 byte. So that is why I wrote the buffered routines. The buffered input routine will store the incoming data in the buffer. Then when you use INPUT,WAITKEY etc., this data is pulled out of the serial buffer. The variables mentioned in the sample are only there for completeness. When you want to check the serial input stream try this: -1- open the channel -2- perform some tests if you can receive data with a terminal emulator for example -3- when all is working: dim b as byte,v1 as byte,v2 as byte do b = waitkey() ' get a byte from the serial input if b = &H20 then ' for example value of first byte b=waitkey() ' get next if b = &H78 then ' vaue of next byte ' when you get here it means you can get the next 2 bytes v1 = waitkey() : v2 = waitkey() ' get the values gosub dosomething end if end if loop dosomething: ' do an action here return Best regards, Mark Alberts -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Len Gabrielson Sent: dinsdag 10 juli 2001 9:13 To: [email protected] Subject: [bascom] BASCOM-AVR Buffered Serial Problems (repeat) Hi again folks, I don't know what happened to that last message, but it came back to me is some weird format, so I'll try again... I'm sorry, but either I better go back to STAMPs or I need some further explaination. Near the bottom of the RS232BUFFER.BAS sample it tells you some variables that are used in the routine. It also says that you won't lose characters, IF YOU EMPTY THE BUFFER, but THE EXAMPLE DOESN'T TELL YOU HOW TO DO THAT! I am monitoring the _WPOINTER and _WCOUNTER bytes, and they always show me a '0', even though there is data coming in. Is there a variable that represents the buffer itself, so that I can go in and look for the byte/s I need? Signed, very confused. >From the RS232BUFFER.BAS sample: This time the chars are received by an interrupt routine and are 'stored in a buffer. This way you will not loose characters providing that 'you empty the buffer 'So when you fast type abcdefg, they will be printed after each other with the '1 second delay 'Using the CONFIG SERIAL=BUFFERED, SIZE = 10 for example will 'use some SRAM memory 'The following internal variables will be generated : '_WPOINTER BYTE , a pointer to the location of the buffer that was written last '_RPOINTER BYTE , a pointer to the location of the buffer that was read last '_WCOUNTER BYTE , a counter that holds the number of chars in the buffer 'calling _recChar0 will decrease this var , when a char is received it will be increased '_RS232INBUF STRING , the actual buffer with the size of SIZEb
-->
For most devices, the Ports device setup class and the Serial function driver provide the functionality required to operate serial ports and COM ports. To install serial ports and COM ports using these system-supplied components, do the following:
Provide an INF file that specifies the Ports device setup class and the Serial function driver as the service for the port.
To configure a serial port as COM port, comply with the requirements that are defined in Configuration of COM Ports.
For more information about installing serial ports and COM ports using the Ports device setup class and the Serial function driver, see the following topics:
If you do a custom installation of a COM port, you must comply with the COM port requirements that are defined in Configuration of COM Ports.