Thanks! Your advise helped me to locate the problem! The pins on the female socket were reversed by misunderstanding of the schematic, I realise that when I was trying to make the HyperTerminal to talk to its self. Now I have my own example running and I will make the required changes to adopt it to my future applications when needed. I am providing the code below just to look at it as an experienced PIC user (compared to the beginner me) and comment if there is a better way to do some things. Haris ;This fragment of code receives a character from a terminal through RS-232 ;and sends it back plus "OK" bsf STATUS,RP0 ;Goto Bank 1 bsf TRISC, 7 ;Set bits 6,7 as specified in the bsf TRISC, 6 ;datasheet clrf TXSTA ;Clear TX control register. bsf TXSTA,TXEN ;Enable Transmit bcf TXSTA,BRGH ;Select low speed baud rate movlw .51 ;constant for 1200 baud movwf SPBRG ;Load the constant for 1200 baud bcf STATUS, RP0 ;Back to bank 0 bsf RCSTA,SPEN ;Enable Serial RX bcf RCSTA,RX9 ;Select 8bit RX bsf RCSTA, CREN ;Enable continuous RX loop btfss PIR1, RCIF ;Wait for RX goto loop ; movf RCREG, w ;Get the char bcf PIR1, RCIF ; clear char. present flag movwf TXREG ;Send the char. back movlw 'O' ;Send OK movwf TXREG bsf STATUS, RP0 ;bank 1 wait btfss TXSTA, TRMT ;Is TSR Reg. Empty i.e. Ready to send new char? goto wait ;No? wait a while bcf STATUS, RP0 ;Back to bank 0 movlw 'K' movwf TXREG goto loop ;go back ----- Original Message ----- From: "Bob Barr" To: Sent: Saturday, December 29, 2001 8:22 PM Subject: Re: [PIC]:16F877 MAX232 RS-232 to PC Example Request > > Luck has very little to do with RS-232 interfacing; you need to use a > bit of witchcraft. :=) Part of the witchcraft involves breaking down > the problem into smaller chunks. > > > 1) Hardware connection - > > You don't say so here but you did connect the Signal Ground as well, > didn't you? :=) > > > 2) Handshaking - > > Try jumpering the Tx to Rx at the cable end (without your board > connected). Can Hyperterminal talk to itself? You should see the > characters echoed as you type them. If not, there is either a > connection or a handshaking problem. You can either turn off the > handshaking in Hyperterminal or jumper the handshake signals at your > board. > > [Note: If you change the settings in Hyperterminal, you need to exit > and restart Hyperterminal to get the new settings to take effect. I'm > not sure why this is necessary but it just seems to be the case. There > may be another method to accomplish this but I don't know what it may > be.] > > 3) PIC to Hyperterminal - > > Once you have Hyperterminal able to talk to itself, you can then set > up your PIC code to loop repeatedly sending a character to the PC. If > this works, then you've got the Tx and Rx right and the baud rate and > parity are the same at both ends. If not, you'll need to get them set > the same. > > > Breaking the interfacing down into these smaller steps may help you > diagnose the problem. Good luck. > > Regards, Bob > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics