Use ULP to blink LED

apuder
Posts: 53
Joined: Mon Mar 26, 2018 7:27 pm

Use ULP to blink LED

Postby apuder » Sat Jun 05, 2021 6:03 am

Hi,

I have been looking at this example where the author used the ULP to make an LED blink:
https://github.com/joba-1/Blink-ULP

The example uses GPIO 2 (RTC GPIO 12) to connect the LED. I tried unsuccessfully to change the example to make use of GPIO 25. According to table 4.4 of the TRM GPIO 25 is equivalent to RTC GPIO 6. The blink example uses RTC_IO_TOUCH_PAD2_REG to set the digital function for RTC GPIO 12. There is no corresponding register for RTC GPIO 6, so my question is if it is possible to use GPIO 25 and if yes, how to configure RTC IO_MUX.

TIA,
AP

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Use ULP to blink LED

Postby WiFive » Sat Jun 05, 2021 7:22 am

RTC_IO_PAD_DAC1_REG

apuder
Posts: 53
Joined: Mon Mar 26, 2018 7:27 pm

Re: Use ULP to blink LED

Postby apuder » Sun Jun 06, 2021 4:15 am

Thanks, that helped. I got it to work with:

Code: Select all

WRITE_RTC_REG(RTC_IO_PAD_DAC1_REG, 17, 1, 1)
WRITE_RTC_REG(RTC_IO_PAD_DAC1_REG, 15, 2, 0)
AP

mezzynine
Posts: 12
Joined: Fri Feb 07, 2020 8:05 am

Re: Use ULP to blink LED

Postby mezzynine » Fri Aug 13, 2021 9:26 pm

I got it to blink with the following. My LED is on RTC_GPIO6 (RTC_GPIO_OUT_DATA_S+6), same as GPIO25 (see https://www.programmersought.com/article/40455220487/). The code is taken from https://codingfield.com/en/2019/01/15/u ... le-simple/.

Code: Select all

loop1:
    WRITE_RTC_REG(RTC_GPIO_OUT_REG,RTC_GPIO_OUT_DATA_S+6,1,1)
    WAIT 65535
    WAIT 65535
[...]
    WAIT 65535
    WRITE_RTC_REG(RTC_GPIO_OUT_REG,RTC_GPIO_OUT_DATA_S+6,1,0)
    WAIT 65535
    WAIT 65535
[...]
    WAIT 65535
    JUMP loop1

Who is online

Users browsing this forum: Baidu [Spider] and 215 guests