Serial comunication problem


Closed Thread
Results 1 to 23 of 23

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    I see you have a LED set to blink on for 1 sec, then off for 1 sec. Is the LED blinking and at the correct speed?
    -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!

  2. #2
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Hi Bert,

    I have fogot to say, it is only a luminose control to see if all work well(I don't have put it on the scheme).
    And yes it seem blink 1 sec and 1 sec no. It's hard to say just lookin at it
    but the time seem correct yes.

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


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Well that would seem to rule out any OSC issues. The Pic is running and running at 4Mhz as you have programmed for. At this point, I think I would just have it run and start touching stuff. Maybe there is a breadboard problem or something like that. If it worked yesterday, even just for a few times, it seems like the code is good. So the only thing left is hardware.

    Wiggle the caps while watching the PC to see if "hello" magically appears. also all the wires. Do this 1 at a time to try and isolate the problem.

    Maybe even try a different output pin, Or move the parts around on the BB. I have had BB's fail on a pin here and there from the socket not making good contact.
    -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!

  4. #4
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Quote Originally Posted by cncmachineguy View Post
    Well that would seem to rule out any OSC issue
    Yes I think the problem is there, but maybe in the code or maybe I dont' sent
    some registry of 16f676 IC.

    I say this because I have change the PIC circuit in a 1000hole board and I get
    the same garbage.
    I think to have change something in the code about OSC define or something
    aroud and the serial work.
    I anyway I can wrong, but the only thing ever same is the MAX232 circuit,
    but there is only some condensator so I can see any thing wrong.

    Maybe some one have made the same circuit with PIC 16f676 and Max232
    and he can check if the code, expeccialy the Oscillator define, is correct ?

  5. #5
    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

  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

    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

  7. #7
    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

  8. #8
    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

  9. #9
    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

  10. #10
    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

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