cant connect mc to pc

Status
Not open for further replies.

cease_fire

Junior Member level 1
Joined
Apr 1, 2010
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
patna
Activity points
1,417
hi,
i have built a programmable mc circuit using at89c51 and i am using hyperterminal to interface it with pc,but i am not getting any success(.i have uploaded the ckt diag).
i have made following changes to the ckt.
1>in db9f i hadnt connected 6 to 4 and 7 to 8.
2>in max 232 i took all cap values 10uf(is it correct or i shud use 1uf and should all the cap vltg must be 25v)
3>in mc i have taken the cap value 33pf at xtal1 xtal2.

how should i know that my mc is connected using hyperterminal as i get no response there.evn
 

how should i know that my mc is connected using hyperterminal as i get no response there.evn

well, you make sure that your hardware connection is good, and then you make sure that your software is good.

it is hard to mess up uart connection as in the simplest case, you need 1 signal wire (PC Tx to MCU RX, or the other way around), + ground/common.
 

First, connect pin2 and pin3 on DB9 and test the loop - while the Hyperterminal is running - press any key - do you see this character on the screen?

Next, the baudrate issue - both ends must use the same baudrate ..
What the code that resides in the 89C52 suppose to do?



Also, here is much better terminal software(free):
**broken link removed**

IanP
 

    cease_fire

    Points: 2
    Helpful Answer Positive Rating
@Ianp..thnx for that i will check those pins.
one thing more, i am very much concerned about the capacitance values in max232 ic..
so the cap values in my ckt is correct?

Added after 1 hours 32 minutes:

ya i tried,i connected those two pins and i can see the letters that i was pressing in hyperterminal..
then i connected the db9f to max232. and when i pressed any key i can see tx rx glowing in hyperterminal.
after that i moved on to nxt stagel , to check serial dtata transfer and i wrote the following program


org 00h;
MOV TMOD,#20h
MOV TH1,#-3
MOV SCON,#50h
SETB TR1
AGAIN: MOV SBUF,#'A'
HERE: JNB TI,HERE
CLR TI
SJMP AGAIN
end

this will generate letter A continously in hyperterminal if my kit connection is correct.
but the above program has some errors in the 'setb','here','clr', line.. i am unable to remove them...
 

You had problems with bits such as TI or TR1 ..
Once they are declared the problem should disappear, here is the code (hex file attached):


Code:
                       1    $NOPAGING
                       2    $MOD252
                       3    
0000                   4    org 00h; 
0000 758920            5    MOV TMOD,#20h 
0003 758DFD            6    MOV TH1,#-3 
0006 759850            7    MOV SCON,#50h 
0009 D28E              8    SETB TR1 
000B 759941            9    AGAIN: MOV SBUF,#'A' 
000E 3099FD           10    HERE: JNB TI,HERE 
0011 C299             11    CLR TI 
0013 80F6             12    SJMP AGAIN 
                      13    end

VERSION 1.2h ASSEMBLY COMPLETE, 0 ERRORS FOUND
AGAIN. . . . . . . . . . . . . .  C ADDR  000BH  
HERE . . . . . . . . . . . . . .  C ADDR  000EH  
SBUF . . . . . . . . . . . . . .  D ADDR  0099H  PREDEFINED  
SCON . . . . . . . . . . . . . .  D ADDR  0098H  PREDEFINED  
TH1. . . . . . . . . . . . . . .  D ADDR  008DH  PREDEFINED  
TI . . . . . . . . . . . . . . .  B ADDR  0099H  PREDEFINED  
TMOD . . . . . . . . . . . . . .  D ADDR  0089H  PREDEFINED  
TR1. . . . . . . . . . . . . . .  B ADDR  008EH  PREDEFINED

The same way as you tested Tx-Rx at the DB9 connector you can test MAX232, just loop both connections that suppose to go to microcontroller ..

IanP
 

    cease_fire

    Points: 2
    Helpful Answer Positive Rating
i tested the pins..all are correct and working.
but how shud i transfer the hex file to mc using the software that u had given.
i went to the data strike flash programmer option n as i clicked it ,it askd abt some factory password.

Added after 4 hours 48 minutes:

ok.i transferred the hex file to the mc and i was getting something in hex in hyperterminal display when i presses the reset button..but i couldnt see 'A'.

i am using AT89c51, and i read somewhere that i need a rom burner in order to erase and to transfer program again in the mc.is this true??
 

To program the AT89C51 you need a parallel programmer .. that's the only way you can program/erase/program/erase .. it .. see this PDF:
**broken link removed**


IanP
:|
 

well thnx for telling me that i have to use parallel programming ckt.
i had made the serial one.

ya as you said ,i should use the S version that will save my time n my passion,but the prob is its not available here.i have to go to a diff city in order to get that. but no prob i will do that at least this S version will save my time n i can work over projects very soon
nyways thnx for guiding me,i came to know about manythings.
i will consult u again when i'll get the s version.

and here is a better version of hyperterminal,hope u like that..
 

assuming that you are not connecting to a 20 year old PC, its rs232 can function like a uart so you don't need the rs232-uart translator.

all you need to do in this case is to connect the tx pin from the mcu to the rx pin on the rs232 (plus gnd) and you will be able to send stuff from the mcu to the hyperterminal - assuming that you set the right baud rate, stop bits, parity + flow control.

obviously, the above assumes that your software works.
 

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