View previous topic :: View next topic |
Author |
Message |
PRAVEENKUMAR
Joined: 08 Jan 2006 Posts: 3
|
help for rs232 |
Posted: Mon Jan 09, 2006 3:21 am |
|
|
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 |
|
|
Paolino
Joined: 19 Jan 2004 Posts: 42
|
|
Posted: Mon Jan 09, 2006 3:40 am |
|
|
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
|
|
Posted: Mon Jan 09, 2006 4:52 am |
|
|
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
|
|
Posted: Mon Jan 09, 2006 4:58 am |
|
|
Ok, post also your "C:\16F73\testrs232.h" file, that you include at the beginning of the code. |
|
|
|