Uart Interrupt Wipy 2.0



  • I need to use the uart interrupt but I found the example for wipy 1.0 but for wipy 2.0 I can't make it work.

    Is there any example to use uart irq for WiPy 2.0?

    Regards



  • Thanks @bucknall

    Do you have an approximate date for a new update?

    Regards


  • administrators

    @jakarman12 Ah ok!

    We currently do not support interrupts in the ESP32 MicroPython branch for the UART bus. I know this is on the roadmap of things to do, so I'll check with Daniel to see where we are with this!

    Thanks for your patience!



  • Hi @bucknall:

    Of course, here it is.

    from machine import UART
    import pycom
    import time
    
    uart = UART(1, baudrate=9600)
    pycom.heartbeat(False)
    UART.irq(UART.RX_ANY, priority=1, handler=irq_uart1, wake=machine.IDLE)
    
    def  irq_uart1 ():
        print ("Uart Interrupt")
        pass
    
    uart.write('hello')
    
    while  1:
        pass
    
    
    This is the error: 
    **Traceback (most recent call last):                                                                                      
      File "main.py", line 7, in <module>                                                                                   
    AttributeError: type object 'UART' has no attribute 'irq'**
    

  • administrators

    Hi @jakarman12

    Could you please give an example (in MicroPython) of what you are trying to do?

    Thanks!


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.