Serial comunication problem


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Why dont you try bypassing the Max232 and use Debug Mode 1 to rule that out?

    And I just noticed you're using the 16F676; are you sure your OSCCAL value is intact?

    Check this outhttp://www.picbasic.co.uk/forum/showthread.php?t=15268

    Regards,

    Anand Dhuru

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


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    You can do a pretty good "no equipment" check of your oscillator by turning ON a LED, issuing a PAUSE 60000 and then turning it off. Even with human error, if it is ON for a minute, you should be within 2%, which is close enough for communications at 9600 baud. If you want to get even closer, issue the PAUSE 60000 10 times in a row. Turn your LED on at the beginning and off at the end. It takes 10 minutes, but you can easily get much better than .5% accuracy that way. The PBP PAUSE command is *VERY* accurate.

    Also, I highly recommend Bray's terminal program
    https://sites.google.com/site/terminalbpp/

    It works with high-numbered COM ports (useful if you are using USB <-> 232 devices). It works with
    Windows 7 (which does NOT have Hyperterminal), and best of all
    It lets you choose non-standard baud rates. If your PIC is running 5% fast, you can choose 1080 baud if
    you like (not all baud rates may be attainable with all hardware, but the software does a great job).
    Charles Linquist

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


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Oh, and QUIT using those 16F chips! 18Fs are so much better and don't cost any more.
    Charles Linquist

  4. #4
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Quote Originally Posted by Charles Linquis View Post
    Oh, and QUIT using those 16F chips! 18Fs are so much better and don't cost any more.
    I second that.

    Norm

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Not to continue hi-jacking this thread, but I have to a little. What is so bad about the 16F's? They are easier to configure if you are new to datasheets, work just as well (both 8 bit). OK, less memory, but who needs it for starting out stuff? I have a couple of products running 16f676 that have been going strong now for 8 years I think. Work fine!

    I am starting to play with the 18's, but really just because.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Yes they work, but the forum would run a little smoother if most everyone was using the same series of chip. I'm sure MELabs thinks that way also.
    The fact that you can easily get parts with large codespace is such a bonus. You can add features over the years without
    changing much.
    90% of Microchip's really neat parts in the 8-bit realm are in the 18F family (18FxxKxx, 18FxxJxx).
    If you write some routines in ASM, it is much nicer to not have to deal with endless bank switching.
    You can use LONGs and 2000 element arrays.
    Even if you don't need all the neat stuff now, why not get a chip that has the peripherals and codespace now so that you can learn to use the extra features in your spare time?

    And they don't cost more. Easy decision for me. I'll be quiet now.
    Charles Linquist

  7. #7
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    All Solved!!!

    I know that the issue was on Clock, or better, in wrong clock serial syncronization.
    So I have change the Internal Oscillator with a External quarze and made the code
    changing to use it. Now all work very good and without any problem.
    I have take a look on 16f676 Datasheet where is writted than internal clock have a
    little tollerance about on some kilohert. But in other forum discussion I have found
    than the internal clock is barely enought in use on serial asyncronous comunications.
    This is my case.
    Maybe if I work on OSCCAL calibration I will use the Internal clock.
    But if I put OSSCAL issue on Picbasic source the PBP give a error, like if OSSCAL is
    not avaible on 16f676.
    I have lost a week on this problem but now all is over and in anyway I have get more
    experience about use and expecially the "non-use" of internal oscillator for some specified
    task like comunications, where is very important have a good timing.
    Thank to all friends to have spend their time on this post and for goods solution proposed
    to me.
    This forum is a very good mine of competent and friendly people. I will hope to give some
    contribution in future.
    Thanks again.

  8. #8
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Quote Originally Posted by ardhuru View Post
    And I just noticed you're using the 16F676; are you sure your OSCCAL value is intact?

    Check this outhttp://www.picbasic.co.uk/forum/showthread.php?t=15268

    Regards,

    Anand Dhuru
    Hi Anand,
    I have tried today your example and I did some experiment,
    and of corse it works very good!!!
    It's a easy way to use the PIC with internal oscillator
    in serial comunications, or other critical tasks where timing
    is crucial, without the use of an external quartz.
    Thanks a lot for your advice.
    Regards,
    Gabriele

  9. #9
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Glad it helped, Gabriele. Now that you have the calibrated OSCCAL, you could fairly safely ramp up the baud to 9600.

    Regards,

    Anand

  10. #10
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Oh Yes now I can Burd the Sky!!!
    Thanks again to have helped me and for knowing on forum.

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