View previous topic :: View next topic |
Author |
Message |
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
Getting rubbish data on my hyper terminal.... |
Posted: Fri Jan 20, 2006 6:54 am |
|
|
I am connection to PIC and hyper terminal accordin to the pic below...
In hyper terminal, I use 9600-8-N-1 Xon/Off
I am getting rubbish data....when I use oscilloscope probe to the output, I can see that there are data stream output...
seems lik my baud setting aint right??
what settting should i use??
thx
sonic
|
|
|
Roebi
Joined: 12 Jan 2006 Posts: 6
|
baud rate setting |
Posted: Fri Jan 20, 2006 8:06 am |
|
|
Do you have a statement such as:
Quote: |
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
|
somewhere in your code? The clock=number should be the frequency of your oscillator circuit.
If this does not help yet, check the data sheet: The clock you are using may possibly not allow to set the baud rate generator such that it matches 9600 bps. The match should be better than 1 to 2 % - otherwize garbage will possibly result. If you can not set BRG such to meet this "band", change the oscillator frequency accordingly.
Example:
Assume you select BRGH =1, then
baudrate = clock /(16 * (BRG+1)) and setting BRG = 129
baudrate = 9615 or 9600 + 0.16% which is ok. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Jan 20, 2006 8:23 am |
|
|
Quote: |
In hyper terminal, I use 9600-8-N-1 Xon/Off
|
Two comments:
1) Try with another communication program. This forum is plenty of complaints regarding Hiperterminal.
2) Change the option Xon/Xoff by none.
Xon/Xoff is a protocol for control the flux of data between a computer and other devices,
if you are not managing this, do not use it.
Quote: |
what settting should i use??
|
The selected setting used in the code header must be the same used in the PC side.
Same Speed
Same number of Data bits
Same number of Stop bits
Same Parity
Same Data flux control.
In the Help Manual you will find how to configure the PIC comm.
Humberto |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Jan 20, 2006 10:18 am |
|
|
What are you using for a clock, a crystal, a ceramic resonator, the PIC internal oscillator, RC? Could it be that your clock is a little off frequency? Can you try the PIC at 10080 or 9120 baud (9600 +/- 5%)? Some PCs can be a few % off too.
On your scope can you compare a "U" sent by the PC vs a "U" sent by the PIC? _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
|
Posted: Mon Jan 23, 2006 12:41 am |
|
|
I am using 16 Mhz with 2 pieces of 22p F cap....
apart from hyper terminal...is there any SW that I can use to communicate??
|
|
|
edhaslam
Joined: 15 Jul 2005 Posts: 89 Location: UK
|
|
Posted: Mon Jan 23, 2006 6:48 am |
|
|
sonicdeejay wrote: |
apart from hyper terminal...is there any SW that I can use to communicate??
|
Try using TeraTerm (use Google to search for their website) - it's freeware.
Ed |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Jan 23, 2006 8:32 am |
|
|
I prefer a program called Terminal, available free at http://bray.velenje.cx/avr/terminal _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
edhaslam
Joined: 15 Jul 2005 Posts: 89 Location: UK
|
|
Posted: Mon Jan 23, 2006 11:22 am |
|
|
Looks good |
|
|
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
|
Posted: Tue Jan 24, 2006 12:17 am |
|
|
h**p://hp.vector.co.jp/authors/VA002416/teraterm.html
teraterm doesn't have WInXp version?? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Tue Jan 24, 2006 12:29 am |
|
|
teraterm doesn't have WInXp version?? [/quote]
I use Teraterm Pro ver 2.3 (1998) on XP and it works perfectly.
Post your fuses... _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
|
Posted: Tue Jan 24, 2006 12:48 am |
|
|
asmallri wrote: | teraterm doesn't have WInXp version?? |
I use Teraterm Pro ver 2.3 (1998) on XP and it works perfectly.
Post your fuses...[/quote]
I using terminal and I use 1uF cap..it is working ,,,
but data is stuff with rubbish??ppl... |
|
|
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
|
Posted: Tue Jan 24, 2006 2:32 am |
|
|
#if defined(__PCM__)
#include <18F2331.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=16000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8) // Jumpers: 8 to 11, 7 to 12
#elif defined(__PCH__)
#include <18F2331.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=16000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8) // Jumpers: 8 to 11, 7 to 12
#endif
void main() {
int i, value, min, max;
//printf("Sampling:");
//setup_port_a( ALL_ANALOG );
//setup_adc( ADC_CLOCK_INTERNAL );
//set_adc_channel( 0 );
do {
delay_ms(1000);
output_high(PIN_A4);
//delay_ms(1000);
//printf("Sampling:\n");
printf("The Voltage is ");
delay_ms(1000);
printf(" 1500 ");
delay_ms(1000);
output_low(PIN_A4);
delay_ms(1000);
} while (TRUE);
}
this is my code... |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Jan 24, 2006 6:16 am |
|
|
Your code should run.
Let's check the hardware: going to the schematic you posted, did you measure the
voltage generated by the MAX232 at PIN2 to Gnd and PIN6 to Gnd ?
Could you tell us the voltages at PINs 11, 12, 13 and 14 (MAX232) when the circuit is in idle state ?
Humberto |
|
|
sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
|
Posted: Fri Jan 27, 2006 3:57 am |
|
|
It works so fine...when I connect this way.....thx all for helping me out...
[img]http://www.photoi.org/share/upload3/1/2/810601127/max232connection.bmp[/img] |
|
|
|