19200 Baud In Pic16f690


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2008
    Posts
    20

    Unhappy 19200 Baud In Pic16f690

    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

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MARGARITA View Post
    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.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    May 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default 19200 Baud In Pic16f690

    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

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Did you change the OSC setting from XT to HS as suggested in Post #2?

  5. #5
    Join Date
    May 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    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.

  6. #6
    Join Date
    May 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    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.

  7. #7
    simpsonss's Avatar
    simpsonss Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MARGARITA View Post
    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.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by simpsonss View Post
    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

  9. #9
    Join Date
    May 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Filter Power Supply

    Quote Originally Posted by simpsonss View Post
    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.

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MARGARITA View Post
    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. 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 ?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  11. #11
    Join Date
    May 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    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. 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.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 02:17
  3. PIC12F675, accuracy of baud rate with Internal Oscillator
    By Chris Mayhew in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st August 2005, 22:41
  4. 16F877A serin problem with baud rate 19200
    By leemin in forum Serial
    Replies: 1
    Last Post: - 31st July 2005, 09:45
  5. Baud Rate and Timing Calculator
    By picnaut in forum General
    Replies: 3
    Last Post: - 23rd January 2004, 16:48

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts