9600 baud using 12F675 INTRC_OSC


Closed Thread
Results 1 to 5 of 5
  1. #1
    AndyP's Avatar
    AndyP Guest

    Default 9600 baud using 12F675 INTRC_OSC

    When I first tried communication at 9.6K using the internal RC oscillator on the 12F675, I just got mumbo jumbo at the receiving end, but browsing through the manual and on this forum's FAQ section etc, I have found that if you are patient enough to callibrate the RC oscillator in the 675, 9600baud IS possible.

    On the datasheet it said that %11111100 (252) was the max frequency, and %00000000 (0) the lowest. When I outputted the value of OSCCAL to an LCD, by default it was set to 128, approx half way between these two values.

    I then hooked the scope up to pin GPIO.4 (remembering to add:
    @ DEVICE pic12F675, INTRC_OSC_CLKOUT

    at the start of the program and measured the frequency of the oscillator. It is infact Fosc/4, i.e 1Mhz, which equates to a cycle period of 1us.

    When OSCCAL was set to 252, my cycle period was: 0.76us.
    When OSCCAL was set to 0, my cycle period was: 1.2us.

    By decrementing the value of OSCAL by 8 and re-measuring, I managed to get the oscillator bang on 4Mhz. The actual value in the end was 88 (%01011100). I am now successfully communicating at 9600 baud to other pics etc..

    Dont know if this might be useful to anyone with a scope, but it has made my day, and saved me 2 pins!

  2. #2
    Join Date
    May 2004
    Location
    Sweden
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Nice that you posted your effort, i haven't tried the 675 int osc yet but how much is the osc/timing drifting in normal "indoor" climat.

    Is it reliable for serialcomm after calibration ? within 5-10 deg C?

    Brgds Roy

  3. #3
    AndyP's Avatar
    AndyP Guest


    Did you find this post helpful? Yes | No

    Default

    I dont know yet how stable the internal oscillator will be, but as the project I am working on is an outside temperature sensor, I will let you know just as I find out!

    At the moment, the comms are very reliable, I dont get any weird characters, but having said that the temperature is a constant 25 degrees in here..

  4. #4
    Join Date
    May 2004
    Location
    Sweden
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Ok, interesting, keep us all informed.

    Brgds Roy

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    @ AndyP

    This is quite interesting.

    My experience is with a "well calibrated" INTRC-OSC at one end and a Crystal at the other end (PIC-2-PIC communication)
    you can get more or less reliable communication even @ 9600.

    With INTRC-OSC at both ends 4800 was the maximum I could achieve (reliable).

    If either one of the two PICs has a tuned Crystal the Dirift of the RC-PIC doesn't matter that much,
    but if they are both RC "clocked" and they drift different ways it does matter.

    Please keep us posted.

    rgds.

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. PIC 18f1220 EUSART Baud Rate Cache Problem
    By wklose99 in forum Off Topic
    Replies: 3
    Last Post: - 15th April 2008, 00:39
  3. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 02:17
  4. 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
  5. 115200 Baud to 9600 Baud Translator
    By ScottC in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd March 2005, 10:16

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