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 support@ccsinfo.com

help for rs232

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PRAVEENKUMAR



Joined: 08 Jan 2006
Posts: 3

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

help for rs232
PostPosted: Mon Jan 09, 2006 3:21 am     Reply with quote

Good day all,
I am new to PIC controllers, any how i managed to creat a program for rs232 comm. with the pc. Just i want to send a letter continiously, i tried but the pc reads some garbage.

i just wrote printf("I");, after setting the baud rate and all.

anyone help,
thanks Embarassed
Paolino



Joined: 19 Jan 2004
Posts: 42

View user's profile Send private message

PostPosted: Mon Jan 09, 2006 3:40 am     Reply with quote

Send us info about:
1) PIC you are using;
2) CCS compiler version;
3) post your code (use the available CODE button).

Then a simple question: are you using a demo board (such as PICDEM2 or others) or your prepared your own hardware? In this case, did you connected correctly the PIC to a RS232 level converter (such as MAX232 or MAX233 or others)? And this level level converter in correctly connected to your PC?

Best regards.

Paolo.
PRAVEENKUMAR



Joined: 08 Jan 2006
Posts: 3

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

PostPosted: Mon Jan 09, 2006 4:52 am     Reply with quote

Hi all;

I am using pic16f73 chip, I used a maxrs232 level converter ic. The pc reads but its not the same. I found it adds a value of 80 hex data to all the characters i try to transmit. I prepared my own hardware.
I am using PCWH, IDE v-3.43 and PCB,PCM,PCH-3.204.
The code is





Code:


#include "C:\16F73\testrs232.h"
#USE RS232 (baud=1200,xmit=PIN_C6,rcv=PIN_C7,force_sw)
#use delay (clock=4433600)
void main()
{

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_spi(FALSE);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
 
   while(1)
   {
   printf("A");
   delay_ms(1000);

   }

}


Thanks.
Paolino



Joined: 19 Jan 2004
Posts: 42

View user's profile Send private message

PostPosted: Mon Jan 09, 2006 4:58 am     Reply with quote

Ok, post also your "C:\16F73\testrs232.h" file, that you include at the beginning of the code.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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