Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RS232/TTL Visual basic interface

Status
Not open for further replies.

ikalogic

Member
Hello,

I am starting to build a data link between a 8051 or/and AVR micro controller and the PC through the serial port. I am using USB to SERIAL cables to provide a serial PORT to my LAPTOP.

I'll start with the 8051 (89S52 micro controller)

I'll be using Visual Basic's MSCOMM control to control the communication.

I have all the components ready to be assembled, but before i start i have a little question: Do i have to stick with the 9600 Baud rate?

I am using a 24Mhz crystal, and the baud rate is hence 375000 from the micro controller side. In Visual basic, do i simply enter 375000 in the baud rate field? Or are there certain values that i have to stick to?

Thanks for the help ;)
 
hi,
From VB HELP .
 
Last edited:
ericgibbs said:
hi,
From VB HELP .

So that means the maximum i can use is 28800?

I cannot use the reserved Bauds right?

Can you send me this help file? i can't find it in my version.

Thanks
 
ikalogic said:
So that means the maximum i can use is 28800?

I cannot use the reserved Bauds right?

Can you send me this help file? i can't find it in my version.

Thanks

hi,
No,
I can transmit and receive upto 128000 baud, between two PC's , no problems.

EDIT:
Just got an invalid setting message at 128000, the other baud rates seem OK.
 
Last edited:
hi,
This is the Comms page from the help file. txt format, the doc format was too big for the uploader.
 
Last edited:
Bear in mind that USB/Serial converters are normally very slow devices, because USB is a packeted system, and serial a byte system. Sending single bytes drops USB 1.1 down to about 9600 baud maximum. So while your serial conection speeds may be much higher than that, the actual throughput may be slow.
 
Thanks, In think i'll start with a gentle 1200 baud rate and using a MAX232 IC, then i'll start speeding up the process and also try to use cheaper buffer ICs (to replace the MAX 232)
 
Unless you are doing this as a learning experience I would hunt for an existing USB solution.

You may want to look in to the USB bitwacker project. It allows BASIC programs on the PC to manipulate the IO on a PIC. It is a single chip solution and you can build it yourself for next to zip or buy a kit from sparkfun for about $20.

The PC interface is written in liberty basic but it could easily be ported to VB. The BASIC interface uses virtual serial ports. You do not have to mess with the USB interface directly. It runs at USB speed regardless of baud rate settings.

It may be that the uC code provided will do what you need. If not you can modify or replace it, free C18 compiler. You do not need a PIC programmer. The firmware is programed via a boot loader. Recompiling the code with a different linker script will allow you to program it with a ICD2 or PICkit.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top