Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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

Gorilla

Member level 5
Joined
Jan 13, 2003
Messages
89
Helped
9
Reputation
18
Reaction score
0
Trophy points
1,286
Activity points
902
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...
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,497
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:

http://www.8052.com/forum/read.phtml?id=24408&top=

Read carefully all replies.

Regards,
Silvio
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,497
...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 ?
 

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
hello

silvio:

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

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top