Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8051's 9th bit and Visual Basic

Not open for further replies.


Junior Member level 3
Sep 17, 2002
Reaction score
Trophy points
Activity points
im going to post this here too..... :? :oops:

Ok, here's the thing:

Im making this project...which envolves 3 AT89C52... 1 is the Master the other 2 are slaves.... all the embedded stuff is done including 4 DS1620 as temperature sensonrs, 1 keypad and 1 LCD....

My problem started with the interface with the computer... im making the application on Visual Basic 6 (the app that will run on the computer)

My "MAIN" problem starts with the master/slave configuration... seeing as in master/slave you use 9 bits for the serial transter... as in:

when the master tries to indentify a slave.. it sends the adress of that slave with the 9th bit SET... after that... the slave turns off his SM2 bit and that makes him a slave will revice data with the 9th bit CLEARed... the other slaves wont be affected cause they still have their SM2 SET (this makes him a slave)...ok back to the problem..

i set the serial comm configuration on my VB app to be at 9 bits.. but.. since the computer doesnt have an SM2... how do i make it a slave??

it will always listen to all the stuff i send to it, regardless of the nith bit...

how did you guys attacked this problem? can one read bit by bit on VB?
where does the 9th bit go???

i think you guys get what my problem is... and i hope you can help out...

best regards and i await your answer.... :? :oops: :(

On the PC, almost all RS-232 ports only work with 7 or 8 databits (with 8 databits most commonly used).

While in your software you may be able to set the configuration for 9 bits, I very much doubt the actual hardware will do that.

Also in the RS-232 recommended standard, the is no such thing as "master" or "slave", this is strictly a thing of the microcontroller used.

So in my opinion, this is not going to function without additional work...

You might consider using a standard 8N1 setting, and create a little protocol that implements the master/slave idea.

If you must use the 9 databits setting, you probably need to create a "8 to 9 bits interface". One side talking 8 bits to the PC, and using a special protocol to set the address of the converter. The other side talking 9 bits and implementing the master/slave protocol.

Well, I hope I didn't make it too complicated...

Man, that's really bother you, since you post same topic on two forum's areas.
I know it's not nice to merely reference that site, but since it was a serious debate there on subject, it worths take a look:

**broken link removed**

Read carefully all replies.


...which envolves 3 AT89C52... 1 is the Master the other 2 are slaves....
.. since the computer doesnt have an SM2... how do i make it a slave??

So, your system has a master AT89C52 and three slaves : 2 of AT89C52 and the third one is PC ?
You don't want the PC as master and three AT89C52 as slaves ?



No, one AT89C52 is the master, 2 AT89C52 are slaves, and the PC is also a slave :oops: :oops:

Not open for further replies.

Part and Inventory Search

Welcome to