Using a new PIC part no. for the first time is always such an adventure.


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Location
    Madison, WI, USA
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Got it going but..

    I spent 6 hours studying the docs. It didn't take long to get the oscillator right but disabling all the special purpose pins is a real bear.

    Anyway, I got the USART working, partly anyway, I can get the PIC to output text to the PC via my serial cable and RS232-9 pin connected to TX pin, but sending characters back to the PIC into the RC pin, is really not working. I have set BRGH high (1) and SPBRG for 9600 (25) for the 4Mhz Fosc. Enabled receive and set all the other bits I can determine to be necessary. Still no go.

    Maybe the internal RC clock is not precise enough. I am going to retrofit an external oscillator ext and see if that works, otherwise I've hiot another wall.

    Anyone out there used this animal in USART implementation?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I know it's a long debate and some have success, some not, but i never suggest to use internal osc for reliable serial comm. BUT you can reduce the baudrate, say 2400 baud, and do some tests.

    Use PICMultiCalc to get the USART settings for you.
    http://www.mister-e.org/pages/utilitiespag.html

    Yours seems to be the good one... just post your code here and maybe we could suggest you few things.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Mar 2005
    Location
    Madison, WI, USA
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Calculator and stuff

    Pretty cool calculator. Looks like you have a pretty good handle on DataComm.

    I'm going to retrofit the external osc. tonight and see what happens. I only have two osc. right now that run at 4Mhz. That has always been fast enough on my 16F628A's to get 9600. In my real time application though, 2400 might be enough.

    I refined the code last night and will work on it again tonight, so I could attach it as a .txt file tomorrow.

  4. #4
    Join Date
    Mar 2005
    Location
    Madison, WI, USA
    Posts
    20


    Did you find this post helpful? Yes | No

    Default External Osc works great

    I found and 8Mhz osc. laying around and put it into the circuit. With the specs. from the baud calculator inserted into the code the code ran first time out giving me accurate I/O from the PC. Now I'm just one pin short of getting 32 outputs. I'll probably be forced to use the input only MCLR as a DebugIn and another one for DebugOut instead of the hardware serial. That would free up C6 & C7 for outputs.

    Thanks for the pointers.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    well, there's always pros and con for using external OSC, if you have many push buttons, you may use the ADC and read from it. a r2r network and ADC can work with at very least 16 push buttons. many many stuff can be multiplexed as well.

    You could also waste your time and try to tweak the internal osc using OSCTUNE... as i said... a REAL waste of time knowing the cons of internal RC osc for reliable timing needs.
    Last edited by mister_e; - 20th December 2007 at 21:58.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  3. newbe looking for PIC advice
    By Mad Professor in forum General
    Replies: 3
    Last Post: - 27th May 2009, 07:56
  4. Can a PIC PIC a PIC?
    By afbecker in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2008, 19:55
  5. Linx RF -> HSERIN time delay / time critical app...
    By batee in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th October 2004, 15:04

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