2nd hardware UART


+ Reply to Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    good catch Henrik.

    I guess we can bodge this by editing the K42.lib file but then it won't work for K42 devices so, yeah... :-(
    I wouldn't do that. There are a lot more differences between the K42 and the K83 than just the U2IF flag... the K83 should really have its own set of libs.

    You can specify which library to use for a device in the *.pbpinc file.
    For example PIC18F26K83.PBPINC specifies
    LIBRARY "pbp_pic18FxxK42_Long"
    LIBRARY "pbp_pic18FxxK42"

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Aah, right, now that you mention it I remember seeing that information somewhere - which turned out to be in post #8 in a thread on MeLabs forum. Things like this really should be in the manual.

    Anyway, that means that we have a chance of fixing issues like these in case MeLabs won't. Thanks tumbleweed!

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Thanks Henrik,
    As Tumbleweed said: good catch! Okay, it's probably a bit beyond my paygrade to fix, but at least that sheds some light on the root cause.

    Cheers,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Charles promissed that he would try to fix any issues found with the exixting version of PBP.

    Maybe you can report that to him or the melabs forum.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Thanks Ioannis,
    I'll endeavour to contact Charles and pass on the issue. As this is pretty much my go-to processor these days, it would be nice to have the issue fixed.

    Cheers,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Then you may report back,

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Quote Originally Posted by tumbleweed View Post
    good catch Henrik.


    I wouldn't do that. There are a lot more differences between the K42 and the K83 than just the U2IF flag... the K83 should really have its own set of libs.

    You can specify which library to use for a device in the *.pbpinc file.
    For example PIC18F26K83.PBPINC specifies
    LIBRARY "pbp_pic18FxxK42_Long"
    LIBRARY "pbp_pic18FxxK42"
    I've started email dialogue with Charles, but to this point raised by Tumbleweed: I will say I've used this processor a lot and I reckon I've used close to 90% of its peripheral functionality (without issue), so the K42 libraries must be very close to being a perfect match I would think.

    edit: although on further reflection, a lot of that was done in a more direct (register access) sense.

    Cheers,

    Troy
    Last edited by rocket_troy; - 19th August 2024 at 02:40.

  8. #8
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    There are a few slight peripheral differences between the two, but most of the changes have to do with the location and layout of the interrupt bits in the various PIE, PIR, and IRP regs.

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Quote Originally Posted by tumbleweed View Post
    There are a few slight peripheral differences between the two, but most of the changes have to do with the location and layout of the interrupt bits in the various PIE, PIR, and IRP regs.
    Okay, thanks, that's good to know.

    I've received some modified or new libraries from Charles with the required include files. Initial testing is showing no issues with transmitting on the 2nd UART. I've only cranked the baud up to 38400, but so far, so good. I only mentioned the 2nd UART issue to him, so I don't know how broadly he looked at the other interrupt registers with making the mods.

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    if it worked at 38400 then problem is solved. Speed is irrelevant to the issue of wrong FSRs.

    I am pretty sure Charles won't object in posting the corrected library file(s) on the forum.

    Ioannis
    Last edited by Ioannis; - 20th August 2024 at 16:33.

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    PBP_TEST.zip

    I think I've done this correctly. Thanks Charles for this.

    Cheers,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: 2nd hardware UART

    Oh, and special thanks again to Henrik for pinpointing the particular code. That helped a lot.

    Troy

Similar Threads

  1. PID-filter routine (2nd try).
    By HenrikOlsson in forum Code Examples
    Replies: 131
    Last Post: - 3rd October 2018, 07:53
  2. Setup baudrate on hardware uart on 18F4520
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th August 2010, 00:31
  3. crucial error in a 90% working hardware uart
    By mimmmis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd September 2008, 14:18
  4. Serial Port Complete 2nd Edition
    By Bruce in forum Serial
    Replies: 4
    Last Post: - 8th November 2007, 15:28
  5. 2nd Order Digital Filter for 24-bit
    By sefayil in forum mel PIC BASIC
    Replies: 0
    Last Post: - 2nd December 2005, 21:55

Members who have read this thread : 13

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