Purebasic Serial Port Example
воскресенье 24 февраля admin 14
Evil Mad Scientist Laboratories. And give two example implementations, on an ATmega168 and on an ATtiny2313. With the pinouts for power supply and the serial. Purebasic usb library in Description LibUSB-Win32 Libusb-win32 is a part of the USB library libusb 0.1 to the Microsoft Windows operating systems (Windows 2000, Windows XP, Windows Vista and Windows 7; Windows 98 SE and Windows ME for versions up to 0.1.12.2 ).
SerialPort PureBasic - SerialPort Overview The Serial port (also know as the RS-232 port) was first created in 1969, and despite its age, it is still widely used in the industry. The process of computer driven hardware prototype creation is simplified when the serial port is used.
This library offers full access to the serial ports available on the computer. Some basic knowledge about the terms used in this documentation will be needed, check for more information.
Command Index Example Supported OS All.
Effective Serial Port Use by Sanjay Mishra Serial ports have disappeared from modern day PCs. However as product designers we still use them to debug and control products because of their simplicity. Here are serial port usage ideas that I have found useful.,,,,,,,,,,,, Choose the Right USB adapter Modern laptops and PCs do not have a built in serial port. The common solution to this is to get a USB to serial port adapter. However not all USB to serial port adapters are created equial. I had timing issues with some that I used before. For the past few years I have used the Radio Shack single port USB to serial port adapter.
While there are other cheaper and maybe betters ones out there, the Radio Shack adapter works for me so I have not had occasion to change. Multiport Adapters There are multiport adapters available as PCI, PCMCIA cards or USB add-ons.
I have used and have been happy with them. Their newest USB adapters gives both RS-232 and RS-485 on the same device which is a big help. Chips for USB to UART for your product The chip manufacturers provide USB drivers for the host operating system.
There are lots of these chips out on the market. I have used chips from FTDI and Silicon Labs.
They are pretty much the same in use. Another option is to bit bang the USB or use controller with built in USB handling capability. Wrangling with Windows COM number assignments When you install serial ports, Windows assigns them numbers. Sometimes the numbers that Windows assigns are not to your liking.
For example your application can only access serial ports from 1 to 10 and Windows assigned your new serial port a number of 11. Well there is a way around it.
Go to Control Panel -> System -> Hardware->Device Manager -> Port -> Properties->Advanced and fill in the COM number that you would like to have. While you are there you might want to take a look at other settings. Your adapter manufacturer may have other controls that you might find useful. Free But Effective Serial Port Terminal Utilities While there are many software utilities and terminal emulators out there, I have found the following to be particularly useful. This is a free software utility.
It has two features that I find particularly useful. Ability to send arbitrary data at the push of different buttons. This enable me to construct different packets for testing the product. I also like the way it has implemented Hex data display. This is available for both Windows and Linux. It has a more polished look and feel.
I use this sometimes. One of its good features is automatic detection of serial ports installed on the machine. I sometimes fire it up just to see which port number Windows has assigned to my device. Serial Port Programming Sometimes your needs go beyond using a simple terminal program. Maybe you want to respond quickly to data received from the test device or do calculations and display the data visually.
For this you will need to write a program in a language of choice. All Operating Systems offer some kind of serial port programming interface. These interfaces allow you to control the serial port in great detail. The easiest way to get started is to get some sample code from the Internet and modify it. Google code search is great for this.
C/C++ is a good option for writing programs that deal with low level programming.and I have written tons of working, deployed code in C/C++. Other langauges that work at near native speed are probably good too. I tried writing programs for serial port data in Interpreted languages (Perl specifically) in 2003 or thereabout and found that they had problems responding to high data rate serial data. That might have changed since then.