Strange problem with Serin/Serout on 16F628


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    16F628 or 16F628A?

  2. #2
    Join Date
    Jun 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default RB3 is also CCP1

    I don't know if this is any help but RB3 is also CCP1. There are some conditions when this may be a problem if RB3 and RB4 are both pulled low. I don't know what other pins you have connected in your circuit but it may be worth checking the CCP1CON register setting. Its also worth checking that Low Voltage Programming is disabled as this sometimes causes problems if the PGM pin is floating. Hope this isn't too far off the mark to be of some use.

    Mike

  3. #3
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Skimask - it is a 628 - not 628A.

    Mike - I'll look into your comments and get back. Thanks!

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Atom058 View Post
    Skimask - it is a 628 - not 628A.
    Are ya sure you're compiling/assembling for the 628 and not the 628A?

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


    Did you find this post helpful? Yes | No

    Default

    I would never bet on the reliability of SEROUT @9600 baud @ 4MHz... manual says black on white that you should use higher speed crystal. Try DEBUG/DEBUGIN.

    Better if you use the INTERNAL USART with hserin/hserout...
    Steve

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

  6. #6
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Well, don't ask me to explain it, but moving TX and RX connections to B.6 and B.7 solved my problem. I tried A.0 & A.1 and B.0 and B.1 and nothing. B.6 & B.7 works just fine... I would be interested if anyone could explain that one! ...

    I didn't want to use HSERIN and HSEROUT as the manual says the I need to use a MAX232. Trying to keep cost and size down.

    But as usual, thanks to all that offered input!

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


    Did you find this post helpful? Yes | No

    Default

    I can understand that you need to keep the cost down, but be aware that - while it may work 90% of the time, the output of the PIC does not meet RS-232 specs. I have occasionally come across computers that would not respond to the PIC's output. Running without a level shifter is OK in the lab, but I wouldn't recommend that you produce a commercial product that way.
    Charles Linquist

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Not all pins are created equal. On the 16F628 RA0 and RA1 are ST "Schmitt Trigger"
    type buffers.

    If the RX pin isn't seeing 0.8 * Vdd (around 4V with Vdd = 5), it wont see high enough
    signal levels when receiving serial data. This can also be affected by external capacitance.

    I.E. even with a TTL type input, external capacitance on the pin can degrade the serial
    data to where it fails.

    One the16F876A RA0 and RA1 are TTL buffer types, and the incoming signal only needs to
    swing from ~2V to ground.

    For reliability, like mister_e already mentioned, you definitely should go with a >4MHz osc
    if you're using 9600 or greater.
    Regards,

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

Similar Threads

  1. strange serout2 problem
    By KaanInal in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th January 2010, 09:33
  2. PIC stop responding - Strange Problem!
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st August 2009, 14:06
  3. strange problem 12f675
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th July 2007, 13:47
  4. Another Serin/Serout Problem!
    By jmbanales21485 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 16:26
  5. 16F628 on-chip eeprom problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 4th March 2004, 07:43

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