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

Getting rubbish data on my hyper terminal....

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



Joined: 20 Dec 2005
Posts: 112

View user's profile Send private message

Getting rubbish data on my hyper terminal....
PostPosted: Fri Jan 20, 2006 6:54 am     Reply with quote

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
Smile
Roebi



Joined: 12 Jan 2006
Posts: 6

View user's profile Send private message

baud rate setting
PostPosted: Fri Jan 20, 2006 8:06 am     Reply with quote

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 Arrow
baudrate = 9615 or 9600 + 0.16% which is ok.
Humberto



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

View user's profile Send private message

PostPosted: Fri Jan 20, 2006 8:23 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 20, 2006 10:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 23, 2006 12:41 am     Reply with quote

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??

Sad
edhaslam



Joined: 15 Jul 2005
Posts: 89
Location: UK

View user's profile Send private message

PostPosted: Mon Jan 23, 2006 6:48 am     Reply with quote

sonicdeejay wrote:


apart from hyper terminal...is there any SW that I can use to communicate??

Sad


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

View user's profile Send private message

PostPosted: Mon Jan 23, 2006 8:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 23, 2006 11:22 am     Reply with quote

SherpaDoug wrote:
I prefer a program called Terminal, available free at http://bray.velenje.cx/avr/terminal


Looks good Exclamation
sonicdeejay



Joined: 20 Dec 2005
Posts: 112

View user's profile Send private message

PostPosted: Tue Jan 24, 2006 12:17 am     Reply with quote

h**p://hp.vector.co.jp/authors/VA002416/teraterm.html

teraterm doesn't have WInXp version?? Sad
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jan 24, 2006 12:29 am     Reply with quote

teraterm doesn't have WInXp version?? Sad[/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

View user's profile Send private message

PostPosted: Tue Jan 24, 2006 12:48 am     Reply with quote

asmallri wrote:
teraterm doesn't have WInXp version?? Sad


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

View user's profile Send private message

PostPosted: Tue Jan 24, 2006 2:32 am     Reply with quote

#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

View user's profile Send private message

PostPosted: Tue Jan 24, 2006 6:16 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 27, 2006 3:57 am     Reply with quote

It works so fine...when I connect this way.....thx all for helping me out...

Cool

[img]http://www.photoi.org/share/upload3/1/2/810601127/max232connection.bmp[/img]
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