• AVR Freaks

Hot!Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations

Author
nmartin
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2019/05/09 09:53:22
  • Location: 0
  • Status: offline
2019/05/09 13:24:00 (permalink)
0

Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations

I have a project configured to use pins RB6 for UART2.TX2 and RB7 for UART2.RX2 so that the onboard PIC16F1454 programmer can bridge the USB composite device's virtual COM port and the PIC18F46K42 target MCU. I did perform a test text string output printf("Hello world!\r\n") and it was successfully delivered to the PuTTY terminal application.
 
So I was attempting to write a small terminal application to easily test various chip peripheral register values and was surprised to find that in PuTTY when pressing any function or arrow keys all the PIC18 ever received was a single byte/character 0x1B (ESC) instead of the expected 0x1B (ESC) O P character sequence for F1 key for example.
 
I rechecked the UART code, it looked fine, and such. Eventually just connected a logic analyzer to the RB6 and RB7 pins on the xpress board and found out that the PIC16F1454 will only send one character at a time with it appeared at least ~20 ms delay before the next character send attempt is relayed. Trying to write characters faster to the virtual COM port will only deliver the first character, that I saw at first, and none of the others no matter the string length until I tried more than 65 characters and saw an interesting pattern of the PIC16 would send the first character of every set of 64 characters.
 
Best that I can determine is that the PIC16F1454 firmware only takes the first character from the USB bulk endpoint receive packet, relays it to the PIC18, and ignores the rest of the packet data. Of course a workaround would be to connect a USB to UART TTL module to PIC18 on alternative UART pins, but I figured I would share my experience with the Xpress PIC18F46K42 board's virtual COM port receive issues.
 
#1

11 Replies Related Threads

    ThoWa
    New Member
    • Total Posts : 11
    • Reward points : 0
    • Joined: 2019/08/23 23:45:40
    • Location: 0
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/22 05:21:33 (permalink)
    0
    I have observed exactly the same behaviour with PIC18F47K42 Curiosity Nano.
     
    Is this is a know behaviour or can somebody help get around this?
     
    #2
    ThoWa
    New Member
    • Total Posts : 11
    • Reward points : 0
    • Joined: 2019/08/23 23:45:40
    • Location: 0
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/22 06:13:12 (permalink)
    0
    I've just realized, that I have had a mismatch in port Settings.
    PIC was using 8 bits, 1 stop bit, even parity
    while terminal in PC was using 8 bits, 1 stop bit, none parity
     
    After correcting this mismatch and Setting PC to use 8 bits, 1 stop bit, even parity I'm able to receive 2 Byte on the PIC, but not more that 2 (independend in used Setting on PC side)
     
    Any idea?
    post edited by ThoWa - 2019/09/22 06:14:17
    #3
    NorthGuy
    Super Member
    • Total Posts : 5688
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/22 06:20:21 (permalink)
    0
    Do Microchip use PIC16F1454 as an onboard programmer and UART bridge on their Xpress boards?
    #4
    newfound
    Super Member
    • Total Posts : 1848
    • Reward points : 0
    • Joined: 2003/11/07 12:35:49
    • Status: online
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/22 22:40:38 (permalink)
    0
    NorthGuy
    Do Microchip use PIC16F1454 as an onboard programmer and UART bridge on their Xpress boards?


    Yes, a composite MSD/CDC class. From the above reports it appears that the CDC class has been implemented very poorly. 
    #5
    ric
    Super Member
    • Total Posts : 23893
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/22 22:49:37 (permalink)
    0
    They should just use NorthGuy's NDSP chips, which are just pre-programmed PIC16F1454's ;)
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #6
    NorthGuy
    Super Member
    • Total Posts : 5688
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/23 21:09:42 (permalink)
    0
    ric
    They should just use NorthGuy's NDSP chips, which are just pre-programmed PIC16F1454's ;)



    Would be interesting to know if they're pin compatible.
     
    newfound
    Yes, a composite MSD/CDC class.



    MSD? How does this work? You just drop a file on it and it programs?
     
    #7
    ric
    Super Member
    • Total Posts : 23893
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/23 21:18:54 (permalink)
    0
    NorthGuy
    MSD? How does this work? You just drop a file on it and it programs?

    Yup!
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #8
    ric
    Super Member
    • Total Posts : 23893
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/23 21:21:03 (permalink)
    0
    https://www.microchip.com...etails/PartNO/DM182026
     

    Drag-and-Drop Programming

    Programming the MPLAB Xpress PIC18F46K42 Evaluation Board is quick and easy. We’ve integrated a unique drag-and-drop programmer for compatibility with almost any USB-connected PC, laptop, or tablet. The MPLAB Xpress Evaluation board connects to your PC as a USB Flash drive, so no drivers are needed. Programming of the target device is completed in microseconds, with no waiting.

     
    I'm having trouble accepting the "Programming of the target device is completed in microseconds" statement at face value though...
     
    post edited by ric - 2019/09/23 21:22:12

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    NorthGuy
    Super Member
    • Total Posts : 5688
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/24 06:31:17 (permalink)
    0
    ric

    Drag-and-Drop Programming


     
    Good idea. You can do it on any device, such as your Phone, or Raspberi Pi (surprisingly many people want to program from RPi), and nothing can change this - you do not need to worry about Apple dropping 32-bit applications, virus-scanners and other annoyances.
     
    It's difficult to specify parameters this way.
    #10
    JPortici
    Super Member
    • Total Posts : 777
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/24 07:35:47 (permalink)
    0
    I personally found it to be an awesome feature.
    There should be the source code somewhere (it was one of the very first projects on mplab express)
    #11
    hevats
    Junior Member
    • Total Posts : 52
    • Reward points : 0
    • Status: offline
    Re: Xpress PIC18F46K42 board virtual COM port bridge to UART receive limitations 2019/09/24 19:39:18 (permalink)
    +1 (1)
    Jack_M
    I personally found it to be an awesome feature.
    There should be the source code somewhere (it was one of the very first projects on mplab express)


    Indeed,
     
    https://github.com/Microc..ech/PIC16-XPRESS-Loader

    https://github.com/MicrochipTech/XPRESS-Loader
     
    bootloaders based on

    https://github.com/majbthrd/PIC16F1-USB-DFU-Bootloader
     
    We are very interested as well for the tons of PIC based products we make, god sent! However I only ever took baby steps in PIC assembly, same for my dev guys.
    #12
    Jump to:
    © 2019 APG vNext Commercial Version 4.5