Hot!USART Read/Write

Author
AH21PE03
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2017/06/21 07:12:56
  • Location: 0
  • Status: offline
2017/07/10 08:43:37 (permalink)
0

USART Read/Write

Hi,
 
Has anybody actually managed to get the UART working with Harmony using the Read/Write model?
 
I've been trying to get this working for over a week, and it's just more effort than it usually is without Harmony.
#1

9 Replies Related Threads

    CinziaG
    rome burns :D
    • Total Posts : 3070
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: USART Read/Write 2017/07/10 11:10:54 (permalink)
    0
    Somebody does use harmony for UART too, and post on this forum. I'd find that "funny" wink
    #2
    Totem
    Super Member
    • Total Posts : 262
    • Reward points : 0
    • Joined: 2014/12/04 02:18:11
    • Location: Mars
    • Status: offline
    Re: USART Read/Write 2017/07/10 19:39:20 (permalink)
    3 (1)
    Open MPLAB Harmony Help and navigate to,
    "MPLAB Harmony Framework Reference > Driver Libraries Help > USART Driver Library > Using the Library > How the Library Works > File I/O Type Read/Write Data Transfer Model"
     
    It is a simple model and I was able to get it worked in the time I played Hans Zimmer's Supermarine track from Dunkirk ;-)
    post edited by Totem - 2017/07/10 19:41:56

    Everything is Relative!
    #3
    AH21PE03
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2017/06/21 07:12:56
    • Location: 0
    • Status: offline
    Re: USART Read/Write 2017/07/11 05:55:59 (permalink)
    0
    Ok, so I've put the following in the main loop, but the RX interrupt is never firing. Any ideas? (Hardware is setup correctly).
     
    appHIDData.countRX += DRV_USART_Read(appHIDData.usartDriverHandle, appHIDData.stringrx, 64);

     
     EDIT:
     
    I followed the code from the harmony help file, created a function with the example code in, but this is causing the USB hub to not be initialised correctly.
    post edited by AH21PE03 - 2017/07/11 06:38:53
    #4
    Tez
    Moderator
    • Total Posts : 462
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: USART Read/Write 2017/07/11 06:42:45 (permalink)
    3 (1)
    Depending on the part that you are running this on, you will need to make sure the UART RX function is mapped correctly to the IO pin. Check the Pin Manager settings in MHC to ensure this. You should then make sure that you have interrupt enabled. Are you running the driver in polled or interrupt mode. If you have opened the driver for blocking mode (DRV_IO_INTENT_BLOCK), then you cannot use the Read/Write model in polling mode. The driver must be configured for interrupt mode.
    #5
    AH21PE03
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2017/06/21 07:12:56
    • Location: 0
    • Status: offline
    Re: USART Read/Write 2017/07/11 06:52:20 (permalink)
    0
    Tez
    Depending on the part that you are running this on, you will need to make sure the UART RX function is mapped correctly to the IO pin. Check the Pin Manager settings in MHC to ensure this. You should then make sure that you have interrupt enabled. Are you running the driver in polled or interrupt mode. If you have opened the driver for blocking mode (DRV_IO_INTENT_BLOCK), then you cannot use the Read/Write model in polling mode. The driver must be configured for interrupt mode.


    Hi,
     
    I'm using a MZ2048EFH144 dev board, got the RX mapped to pin 61 of the PIC, and the physical connection connected to pin 10 of J12 on the PIC dev board. Interrupt mode is ticked, and I have the DRV_IO_INTENT_READWRITE and DRV_IO_INTENT_NONBLOCKING through SRV_USART_Open.
     
     
    #6
    Tez
    Moderator
    • Total Posts : 462
    • Reward points : 0
    • Joined: 2006/10/04 11:09:05
    • Location: 0
    • Status: offline
    Re: USART Read/Write 2017/07/15 23:36:07 (permalink)
    0
    Are you trying use the UART to USB feature on the PIC32MZ EF Starter kit?
     
     
    #7
    LostInSpace
    Senior Member
    • Total Posts : 99
    • Reward points : 0
    • Joined: 2016/03/11 22:47:59
    • Location: 0
    • Status: offline
    Re: USART Read/Write 2017/07/17 06:41:41 (permalink)
    4 (1)
    CinziaG
    >>>Somebody does use harmony for UART too, and post on this forum. I'd find that "funny"
     
    Not so funny (to me) - I use the USART's for communication in every project!    ;-)
     
    #8
    CinziaG
    rome burns :D
    • Total Posts : 3070
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: USART Read/Write 2017/07/17 08:10:17 (permalink)
    0
    I meant USART is ok, harmony is less ok Smile
    #9
    LostInSpace
    Senior Member
    • Total Posts : 99
    • Reward points : 0
    • Joined: 2016/03/11 22:47:59
    • Location: 0
    • Status: offline
    Re: USART Read/Write 2017/07/17 09:13:49 (permalink)
    0
    >>>>I meant USART is ok, harmony is less ok
    Yes, but even the USART's are partially broken on the PIC32MZ's !!!  
    It's simply amazing !!!  wink: wink
    #10
    Jump to:
    © 2017 APG vNext Commercial Version 4.5