hserout issues on the 18F26K83


+ Reply to Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    Use a logical analyzer to see what's coming out of the chip. Compare the output of the SEROUT2 to the output of the HSEROUT2 using the logical analyzer. You might think that your output is 115200, but it is not. I suspect that you have it set up for another baud rate. Also, check if you have the data configured as 8N1.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  2. #2
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    Again, if I have it set up as another baud rate, then why is every text string in quotation marks coming through fine?

    Troy

  3. #3
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    Okay, I think I might have solved this one. I didn't have the TRIS of the transmit pin configured as an output. I was under the erroneous impression the UART controller trumped control of any port setting while active. I misinterpreted page 463 of the datasheet:
    "When TXEN is set and the transmitter is not idle, the TX pin is automatically configured as an output. When the transmitter is idle, the TX pin drive is relinquished to the port TRIS control"

    Damn these serial issues have been throwing some curveballs at me recently. Just transmitting enough correct data to totally throw me off the scent... damn it...

    Troy

  4. #4
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    If you connect a logical analyzer to the serial lines, you know for sure if data is being transmitted or not. That would have saved you a lot of time. I always put in my PCB designs a testing point for all the serial data lines.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    I've been having some issues lately, not with that device specifically but with MCS Serial Communicator (or so it seems). I'm communicating with my board using simple ASCII commands at 57600 baud. Single letter/digits commands (like '?' works most of the time, multi letter/digit commands (like 'P100' works sometimes but most often not.

    Thing is, if I use TeraTerm instead everything works perfectly, same computer, same USB cable, same FTDI adapter, same board. Disconnect Serial Communicator and connect TeraTerm to the same virtual COM port and it just works. I have no idea what's going on, before trying TeraTerm I even changed the PIC chip on the board cause I figured I've damaged the UART pins somehow but needless to say the new chip behaved exactly the same.

    Anyone else seen anything like this when using Serial Communicator built into MicroCode Studio?

    I'm going to put the scope and/or logic analyzer on it and see if I can see anything different.

    /Henrik.

  6. #6
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    I didn't even realize that MCS & MCSX had a Serial Communicator [blush]. Been using them for... dunno... 20+ years and never noticed. The only defence I have is I'm only an occasional user/coder.

    Troy

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    Well, I did knew that but something in my mind was telling me not to use it...

    I also am using TeraTerm and from time to time Br@y Terminal that has some nice automations.

    Ioannis

  8. #8
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    Quote Originally Posted by HenrikOlsson View Post
    ...Single letter/digits commands (like '?' works most of the time, multi letter/digit commands (like 'P100' works sometimes but most often not.
    This could be due to your code and how the two terminals work. MCS will send the data when you click 'send', or when you hit 'Enter' if you have the transmit window setting 'Transmit on carriage return' checked.

    For TeraTerm, this is configurable (char vs line mode), but typically it's set to transmit as the individual chars are entered.

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: hserout issues on the 18F26K83

    Yep, I figured it probably have something to do with that.
    Strange thing is that the code has been working fine with MCS for over 10 years but now it doesn't. So I've messed something up.

Similar Threads

  1. Loop issues
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 30th September 2021, 01:42
  2. A/D compiler issues
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th March 2014, 13:24
  3. A/D, and compiler issues.
    By BobEdge in forum PBP3
    Replies: 4
    Last Post: - 27th March 2014, 13:20
  4. button press AND hserout issues?!
    By Giulio in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st July 2011, 01:22

Members who have read this thread : 17

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