Osctune


Closed Thread
Results 1 to 36 of 36

Thread: Osctune

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I see what you mean. I have never used that feature before. Time to try it!
    Charles Linquist

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    I see what you mean. I have never used that feature before. Time to try it!
    Another neat thing about this feature is that you do not have to set a fixed baud rate in your firmware. I have used it (with IntOSC) to communicate at any standard speed from 2,400 to 230,400 baud. Auto-Baud detect is only available on devices that have an EUSART - most PIC18s (and some PIC16s) do.

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I'm assuming it will pick "odd" baud rates (like 18200 buad, which can result from off-frequency oscillator). I would need that.

    And I always use the "better" chips. I figure that trying to save $2.00 by using a 16F rather than an 18F chip, and then spending a week overcoming its weaknesses is false economy.
    Charles Linquist

  4. #4
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    The nice thing is that it doesn't matter if your PIC18 is off frequency or the sending device is off frequency - it just syncs both units to each other.

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    In my case, I'll have to read the resultant SPBRG and use that to calculate the value for my DEBUGOUT command as well.

    I have a large network of connected devices. The Master (18F8723) polls the SLAVES (a bunch of 18F2221's). It sends out an 'Attention' byte, followed by the Slave's address, followed by a command and finally, a checksum.

    The Slave uses the Receive part of it's EUSART so I can easily use interrupts
    to grab the data. But when answering, the slave must 'speak' open-collector to avoid bus contention. I don't have room for an O.C. gate on the slave, so I can't use the Transmit part of the '2221's EUSART.

    So, I use a different pin (not PORTC.6) to do the send. I use DEBUGOUT in order to get 19.2Kbaud with a 4MHz oscillator. And before you ask....
    I modified PBPPIC18LIB to add a switch to DEBUGOUT that allows it to run in an open-collector mode.

    It all works like a charm.
    Charles Linquist

  6. #6
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default I am really confused

    Hey folks, I finally had a chance to grab a NEW PIC and read it to try and view this factory calibration value. But I can't seem to find it.

    So as I stated earlier I have only 12F683, 16F688 & 16F690 chips. If I put a NEW pic in my programmer (pickit2 w/low pin count demo board) and then "read" the chip, all I see in the "Program Memory" window is "3FFF" in all memory locations. In the "EEPROM" window is "FF" in all locations.

    Where do I look to find this "osccal" factory calibration value?
    Are these chips just too "low end" to have this calibration value?

    Why do I see "3FFF" in the program code area? This translates to 14 binary bits of "1". Why 14 bits? (the .pdf documentation says the 16F688 is an 8bit mcu)

    Is it possible to view all the other "special function registers"? As I look at the .pdf it shows various values for the registers on power-up, and they are NOT all 1's.

    HELP!!

    Dwight

  7. #7
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    1. None of the PIC's you mentioned have an OSCCAL register.
    2. 8-bit PIC'ss have 8-bit data and either 12, 14 or 16 bit program words. The PIC's you have use 14-bit programs words.
    3. When using a programmer, you can only see the program words (3FFF for unprogrammed locations) and EEPROM data (if present in device, FF is the erased state). You will not be able to see values of the SFR's unless you are using ICD.

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