Continue to Site

Welcome to EDAboard.com

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

PIC & 8051 Interface[Strange isnt it ? ]

Status
Not open for further replies.

theone_in_themoon

Junior Member level 3
Joined
Oct 20, 2003
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Lahore Pakistan
Activity points
323
hi...

Ive made an interface in which PIC 16F877A and ATMEL 8051 communicate serially.

PIC has an option in PIC Basic to make the levels True(0-5V) or Inverted(RS-232) levels.

The problem is that PIC is not taking the input from 8051 directly(using True levels). I have to use an additional MAX-232 IC to convert level of 8051 to RS-232 and then PIC receives the data( then i also change PIC levels to inverted).

ive tried using another 8051 in place of PIC .... and that receives the data form the first 8051 correctly.... but PIC doesnt.

Can anyone suggest wat shud be done ??
 

Re: Strange isnt it ?

Don't rule out a problem on the software side.
It is very easy to set up a wrong baud mode, even
in PBP. Perhaps you could post the relevant routine
and we'll have a look at it.

Nick
 

Re: Strange isnt it ?

Well as said earlier ..... just by putting in a MAX-232 ... it starts working .... so there is nothing wrong with the software side ....

Thankyou very much for ur suggestion though .... i wud appreciate if u cud suggest something futher .....
 

Very funny problem :)

What is the length of connection cable between 2 uC?

To check that problem is not on SW side, I would suggest you to connect both uC one by one to PC (you already have MAX232, so it should be not a problem) and check that both can communicate with the same UART parameters with HyperTerminal, for example.
 

The problem is you are communicating with two micros with different output levels, remember, your 8051 is CMOS and your PIC is TTL. That is the reason why it works with MAX232 but does not when connected directly to eacha other, use a level converter to solve the problem.

Glenjoy
 

glenjoy said:
The problem is you are communicating with two micros with different output levels, remember, your 8051 is CMOS and your PIC is TTL. That is the reason why it works with MAX232 but does not when connected directly to eacha other, use a level converter to solve the problem.

Glenjoy

forgive me glenjoy,

what is the difference? CMOS can talk with TTL and the inverse is also true.
what matter is the 0-5V level.
 

I think CMOS is compatible with TTL Levels but TTL to CMOS Levels is not or the opposite is true.
 

glenjoy said:
I think CMOS is compatible with TTL Levels but TTL to CMOS Levels is not or the opposite is true.

Does not matter, if he uses +5V power for both uC.
Even if one device uses +5V and another +3.3V it should work OK.
 

Hi everyone ... i dont know think that TTL and CMOS are INcompatible ... however i will try putting in a resistor.

The length of the wire is VERY short ... cuz both micro controllers are put onto a bread board. ...... less that a 5 cm apart. So length of the cable shud not be a problem .....

Ill try chking the voltage levels though
 

One cannot say generally how compatible CMOS and TTL are - the datasheets of
both chips need to be studdied carefully in the "Electrical Characteristics" section.

For instance, PORTC serial pins of your PIC use a Schmitt Trigger buffer and the
datasheet specifies VIL to max 0,2 VDD and VIH to min 0,8 VDD.
If VDD is 5 V then VIL=1 V and VIH=4. This is not TTL, which is specified to
0,8 and 2,0 V respectively.

The datasheet is your best source of information, read it.

/Rambo
 

OH no need to be sorry at all ..... thank you infact for trying to help ... :)

I will post my reply when i check this solution in a day or two

take care

thanks again

Good Bye :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top