CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RS232 HELP- using Hyperterminal
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: reply
PostPosted: Tue Jul 05, 2005 8:29 am     Reply with quote

Sophi wrote:
Thanks Humberto-
Yes I read everything in the forum - that's how I chose all my settings for Hyperterminal!
I am using a Protoboard (Olimex) that comes with a MAX232 chip. I've connected TX from the MAX232 to PIC- C6 and RX from MAX232 to PIC C7. I'm using a PIC16C74A.
Any advice is appreciated!
Sophi


This is your problem. Take a look at the schematic
http://www.olimex.com/dev/images/pic-p40b-sch.gif

They have Rx going to T2in. This is not Rx of the PIC but rather the Rx signal of the other device. You should have this connected to Tx (C6) of the pic and Tx should be connected to Rx (C7) of the pic.
Sophi



Joined: 14 Jun 2005
Posts: 64

View user's profile Send private message

PostPosted: Tue Jul 05, 2005 8:51 am     Reply with quote

thanks Mark-!
Now pin C6 and C7 are high but still nothing from Hyperterm. Is there something else I need for the settings? Should the received words just come up on the screen or do I need to "ask" HT for it?
Sophi
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 05, 2005 8:54 am     Reply with quote

According to the schematic, you should not be using a Null cable.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Jul 05, 2005 9:16 am     Reply with quote

The previous code I post was just to know if your hardware was running.
To get some "burst" with a scope you need a code like this:
Code:

#include <16c74a.H>
#fuses HS,NOPROTECT,NOWDT,NOBROWNOUT,PUT
#use delay(clock=20000000) // adjust for resonator frequency
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

main()
{
  setup_adc_ports(NO_ANALOGS); // sets port A all digital
  do
    {
     output_toggle(PIN_A0);   
     printf("1234567890");
     delay_ms(100);
    }while(1);                     
}


Be aware that you must change your scope trigger setup to the levels you will find in figure
"One byte of async data" in this link:

http://www.arcelect.com/rs232.htm

and connecting your scope in the DB9 pin 3 (RS232 Tx) you would "see" the output
signals string every 100 msec.

Keep well,

Humberto
Sophi



Joined: 14 Jun 2005
Posts: 64

View user's profile Send private message

PostPosted: Tue Jul 05, 2005 9:34 am     Reply with quote

My PIC speaks to HTerm!
No NULL cable-
Switched TX and RX wires...Thanks!

Mark- I am looking at my schematic and I would never have figured that out from it, what do you see on there that says RX and TX do not go to PIC? And how would I know for future about using NULL or not?

Now to work out how to speak to my PIC from HT....?
Sophi
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 05, 2005 9:35 am     Reply with quote

Pin 2 is the output on the proto board.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 05, 2005 9:38 am     Reply with quote

Sophi wrote:
My PIC speaks to HTerm!
No NULL cable-
Switched TX and RX wires...Thanks!

Mark- I am looking at my schematic and I would never have figured that out from it, what do you see on there that says RX and TX do not go to PIC? And how would I know for future about using NULL or not?

Now to work out how to speak to my PIC from HT....?
Sophi


I looked at the MAX232 chip. Outputs should go to inputs and inputs should go to outputs. As far as the Null cable goes, if both devices have the same pin out then you will need the Null cable. You can find the pin out for a standard pc serial port on the net.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Tue Jul 05, 2005 11:50 am     Reply with quote

Five days ago I suggested you to check this:

Code:

  PIC                       MAX232

 PIN_C6  >--------    Should be PIN 10 or 11
 PIN_C7  <--------    Should be PIN 12 or  9


and your answer was:
Quote:


All is wired as it should be (Thanks Humberto!)



Question Question Question

I assume that check means hardware debug not simply reading a schematic.

Humberto
Sophi



Joined: 14 Jun 2005
Posts: 64

View user's profile Send private message

PostPosted: Tue Jul 05, 2005 1:14 pm     Reply with quote

Yes I had switched the wires a couple of times- back and forth, trying everything. Now with no null cable plus right wiring and HT configured right, all is Smile
Thanks so much for all your help everyone-
Everything works great!
Sophi
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group