SERIN in acii, hex, decimal?


Results 1 to 16 of 16

Threaded View

  1. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The internal osc isn't normally accurate enough for reliable serial communications.

    It may work in one app, then not in the next. If you want reliable serial comms, go for an
    external crystal or resonator. But if you are using the internal osc on this PIC, then you for
    for sure want the DEFINE OSCCAL_1K 1 in there to load the factory osccal calibration value
    at power-up.

    Pretty much any decent device programmer will preserve the factory osccal value, but if it
    doesn't, it's never going to work right with DEFINE OSCCAL_1K 1 in your code.

    I.E. if your device programmer erases the last program memory location where the RETLW
    xx (XX being the factory cal value to load into OSCCAL), and you insert DEFINE OSCCAL_1K
    1 in your code, it creates a nasty loop you'll never get out of.

    PBP inserts a call to the last program memory loaction when you include this DEFINE. If the
    RETLW xx isn't there, it rolls-over back to location 0, and you land on the call repeatedly.

    You can check by just reading your 12F with your programmer and checking to see if the
    last program memory location has been erased.

    If it has been erased, there are several threads here on how to fix this.

    I have an external crystal here that has 5.000 on it, so I assume that is 5mhz. Will this work
    Nope. PBP doesn't support 5MHz osc speeds. Check in the back of your PBP manual in the DEFINE
    section for a list of supported osc speeds.

    There's also a schematic in your manual for connecting an external crystal with caps.

    If you're using a 3-pin resonator with internal caps, ground the center leg & connect the
    other two to the PIC OSC1 & OSC2 pins.
    Last edited by Bruce; - 3rd March 2009 at 00:35.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Serin Help - ASCII to Decimal
    By Dino308gt4 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th October 2009, 23:00
  2. Hex to Ascii to Decimal
    By khoog in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st July 2009, 05:27
  3. hex ascii help please
    By ffr58kk90 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 29th December 2006, 21:09
  4. Convert Hex to Decimal???
    By RONKON in forum mel PIC BASIC
    Replies: 2
    Last Post: - 9th May 2006, 02:14
  5. Reading a Hex value from a Modem and showing it as Decimal..
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th March 2005, 17:58

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