8051's 9th bit and Visual Basic

Status
Not open for further replies.

goosiegoo

Junior Member level 3
Joined
Sep 17, 2002
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
USA
Activity points
191
im going to post this here too..... :?

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.... :?
 

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.

Regards,
Silvio
 

...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 ?
 

hello

silvio:

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

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…