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

8051s 9th bit and Visual Basic 6

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
8051's 9th bit and VB

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

junglejenny

Member level 4
Joined
Nov 25, 2001
Messages
72
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
572
Hi,
The 9th bit if I recall correctly is in the same space as parity. I guess you can set your protocol to PC to be 8 bit, even parity, then do a lot of bit bashing in VB whilst looking for parity error which, in your case is not really an error. etc etc.

Happy hacking.


JJ
 

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
Junglejenny,

You don't recall quite correctly. The 9th bit is in the same space as parity, but identifies an address byte - it is not a Parity bit! Read the MCS51 manual. It's true that you can move the parity bit from PSW into TB8 when sending, but it's not usual behaviour when using multiprocessor comunication feature on 8052 micro.

What goosiegoo is trying to do is enable the PC to receive characters with 11 bits on a PC, 1 start, 8 data, 1 (address - data flag, call it parity if you want), and 1 stop bit.

See also my reply on same topic post by goosiegoo into:

http://www.elektroda.pl/eboard/viewtopic.php?t=46338
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top