Strange problem with Serin/Serout on 16F628


Closed Thread
Results 1 to 24 of 24

Hybrid View

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

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

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

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

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

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

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


    Did you find this post helpful? Yes | No

    Default

    PIC16F88 would be a better choice, internal osc can run up to 8MHz AND you can fine-tune it... for what it worth as it's an RC osc
    Steve

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

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


    Did you find this post helpful? Yes | No

    Unhappy

    The saga continues...
    For a new design, I am using a PIC16F877A and trying to communicate serially with this same MP3 player - essentially running the same code that I had on the 628. You will recall that I "solved" my problem with the 628 design by moving my serial RX an TX pins from PORTA.0 and A.1 to B.6 and B.7. Bruce explained that my problem was due to A.0 and A.1 being Schmitt Trigger (ST) type buffers instead of TTL. I am assuming that what he is implying is that if your pin is a ST, you can not use it for serial communication. Is that correct?

    For my new design on the 877a, I had intended to use pins E.1 and E.2 for communication but, alas, they are ST... I tried moving the serial comm to pins A.2 and A.3 which are TTL and still do not seem to be able to talk to the player. Right now, I am not using a MAX232, just going straight from the PIC pins to the TX and RX pins on the player - just as I am doing with the 628 design. It works on that board, but not on the 877. BTW, I am running both at 20 mHz.

    Can anyone shed some light on this?
    Thanks!

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