PDA

View Full Version : 19200 Baud In Pic16f690



MARGARITA
- 2nd June 2008, 05:27
MY SERIAL TEST CODE WORK PERFECT IN 4 MHZ OSC AT 2400 BAUD BUT MY ORIGINAL CODE NEED WORK AT 19200 I DEFINE OSC 20 AT PROGRAMMING TIME I SET XT OSC IN MPLAB CONFIG. BITS BUT MI CODE DONT WORK WITH 20 MHZ, I CHANGE PARAMETERS FOR 9600 BAUD 8 MHZ AND STILL DONT WORK I CHECK MANUAL PAGE 50 BIT 3 IN OSCCON REGISTER AND CONFUSED ME, IS READ ONLY AS 1 BUT NOTE 1 SAY RESET TO 0 WHEN USING Two-Speed Start-up and Fail-Safemode is enabled, SOUND LOGIC TO ME BUT WHY RESET TO 0 WHEN USING LP, XT or HS THIS MODES ARE EXT OSC. AND WHEN BIT 3 RESET TO 0 = Device is running from the internal oscillator... ANY HELP PLEASE

Archangel
- 2nd June 2008, 06:34
MY SERIAL TEST CODE WORK PERFECT IN 4 MHZ OSC AT 2400 BAUD BUT MY ORIGINAL CODE NEED WORK AT 19200 I DEFINE OSC 20 AT PROGRAMMING TIME I SET XT OSC IN MPLAB CONFIG. BITS BUT MI CODE DONT WORK WITH 20 MHZ, I CHANGE PARAMETERS FOR 9600 BAUD 8 MHZ AND STILL DONT WORK I CHECK MANUAL PAGE 50 BIT 3 IN OSCCON REGISTER AND CONFUSED ME, IS READ ONLY AS 1 BUT NOTE 1 SAY RESET TO 0 WHEN USING Two-Speed Start-up and Fail-Safemode is enabled, SOUND LOGIC TO ME BUT WHY RESET TO 0 WHEN USING LP, XT or HS THIS MODES ARE EXT OSC. AND WHEN BIT 3 RESET TO 0 = Device is running from the internal oscillator... ANY HELP PLEASE
Faster than 4 MHZ Requires HS OSC in config setting, DEFINE HSER_BAUD 19200, DEFINE HSER_TXSTA 24h 'for faster than 4mhz, I wouldn't try to use internal OSC at high baud rates.

MARGARITA
- 2nd June 2008, 19:47
THANKS JOE S FOR ANSWER, MAYBE I WAS NOT CLEAR, MY ENGLISH ES NO GOOD,
THE TEST CODE BELOW IS WORKING GOOD, I NEED 19200 BAUDS AND THEN CHANGE DEFINE OSC 20 AND DEFINE HSER_BAUD 19200, AND ITS NOT WORKING I TAKE CARE TO CHANGE PARAMETERS IN HYPERTERMINAL AND CRISTAL IN BOTH CASES... WHAT ARE MISSING?

DEFINE OSC 4
ANSELH=0
DEFINE HSER_BAUD 2400 ' Select the baud rate
char var byte ' Storage for serial character

start:
Hserin [char] ' Get a char from serial port
Hserout [char] ' Send char out serial port
Goto start ' Do it all over again

End

skimask
- 2nd June 2008, 19:53
Did you change the OSC setting from XT to HS as suggested in Post #2?

MARGARITA
- 2nd June 2008, 21:13
Did you change the OSC setting from XT to HS as suggested in Post #2?
HI SKIMASK, YES I DID WITH SAME RESULT, I FEEL SO BAD BECAUSE I KNOW IS AN EASY THINK, BUT I DO NOT WHAT.

MARGARITA
- 2nd June 2008, 21:38
Now Is Working, I Found Is A Problem With My Power Supply If I Put A 1000 Mf. In Parallel With Power Supply Is Working, Maybe Because High Speed More Sensible To Power Supply Noise, Any Way Thanks Guys Looks That The People Here Are Very Gentil.

simpsonss
- 9th September 2008, 07:14
Now Is Working, I Found Is A Problem With My Power Supply If I Put A 1000 Mf. In Parallel With Power Supply Is Working, Maybe Because High Speed More Sensible To Power Supply Noise, Any Way Thanks Guys Looks That The People Here Are Very Gentil.

hi MARGARITA,

seems like it works with 20 Mhz, i would like to ask a question. I'm facing the same problem as you too. everything works find with 4Mhz OSC but no for 20 Mhz OSC. what u mean by parallel with power supply? i should i connect the circuit?

thanks.

skimask
- 9th September 2008, 11:42
i would like to ask a question. I'm facing the same problem as you too. everything works find with 4Mhz OSC but no for 20 Mhz OSC. what u mean by parallel with power supply? i should i connect the circuit?

http://en.wikipedia.org/wiki/Decoupling_capacitor

Hmmm... 1000mF as decoupling Capacitors - always knew I made my boards way too small... - Melanie

MARGARITA
- 11th September 2008, 22:24
hi MARGARITA,

seems like it works with 20 Mhz, i would like to ask a question. I'm facing the same problem as you too. everything works find with 4Mhz OSC but no for 20 Mhz OSC. what u mean by parallel with power supply? i should i connect the circuit?

thanks.

I FOLLOW INSTRUCTIONS FROM JOE, SKIMASK AND PUT 1000MF CAPACITOR IN PARALLEL WITH 5 VOLTS SWITCHING POWER SUPPY, (SOME ARE POOR FILTERED ) MY WAS ONE.
AND UNTIL NOW MY PROJECT WORKS FINE.

Archangel
- 12th September 2008, 00:49
I FOLLOW INSTRUCTIONS FROM JOE, SKIMASK AND PUT 1000MF CAPACITOR IN PARALLEL WITH 5 VOLTS SWITCHING POWER SUPPY, (SOME ARE POOR FILTERED ) MY WAS ONE.
AND UNTIL NOW MY PROJECT WORKS FINE.
1,000 µF filters are enough to take the ripples off the ocean, I bet your circuit stays powered for hours after unplugging the power supply. :D What you do need, is a .01 µF , that's point zero one µF near your PIC connected to the power and ground pins, these allow radio frequency noise to get shorted out, resulting in "Clean" DC power to your chip. Those 1000 µF would be great in a high end audio amplifier to filter and act as a backup supply when big power surge requirements arise. Might be you were thinking 1000 PF caps ?

MARGARITA
- 13th September 2008, 03:15
1,000 µF filters are enough to take the ripples off the ocean, I bet your circuit stays powered for hours after unplugging the power supply. :D What you do need, is a .01 µF , that's point zero one µF near your PIC connected to the power and ground pins, these allow radio frequency noise to get shorted out, resulting in "Clean" DC power to your chip. Those 1000 µF would be great in a high end audio amplifier to filter and act as a backup supply when big power surge requirements arise. Might be you were thinking 1000 PF caps ?

I Know, but with .1 mfd. I have trouble and with 1000mfd. works ok.