ULP access timer peripherals?

kbaud1
Posts: 71
Joined: Wed Jan 17, 2018 11:55 pm

ULP access timer peripherals?

Postby kbaud1 » Tue Feb 27, 2018 1:57 am

I know the ULP can wake after so many cycles of the 150khz RTC after a "halt". Once the ULP is running, is it able to access the timer peripherals? We have a ULP program that reads an optical encoder into RAM so the main processors can then scoop it up. But the loop rate of the ULP is unstable. With our current program it loops at a varying rate of about 85-120khz.

Would it be possible to sync it to a timer so the loop was more consistent?

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

Re: ULP access timer peripherals?

Postby WiFive » Tue Feb 27, 2018 2:43 am

No most peripherals require the main CPU and clock to be powered up and the ulp cannot access that memory space. But if you have a 32khz crystal you may be able to use it as a secondary reference

kbaud1
Posts: 71
Joined: Wed Jan 17, 2018 11:55 pm

Re: ULP access timer peripherals?

Postby kbaud1 » Mon Mar 05, 2018 12:48 am

We are not trying to save power. we just need a clean read of the pins without fear of being preempted by another process. The ULP can do this but without a timer, it is inconsistent.

Would it be possible to have a hardware timer output to a pin that the ULP can see? It would then use that as a reference.

kbaud1
Posts: 71
Joined: Wed Jan 17, 2018 11:55 pm

Re: ULP access timer peripherals?

Postby kbaud1 » Mon Mar 05, 2018 12:55 am

Or how about the FRC1? Can the ULP access this?
http://esp-idf.readthedocs.io/en/latest ... _get_timev

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

Re: ULP access timer peripherals?

Postby WiFive » Mon Mar 05, 2018 1:38 am

Well in that case I think you can clock the ulp from the crystal/4 reference and instead of doing halt just do a nop counter loop?

kbaud1
Posts: 71
Joined: Wed Jan 17, 2018 11:55 pm

Re: ULP access timer peripherals?

Postby kbaud1 » Sat Mar 10, 2018 1:30 pm

The only clock we have been able to access in the ULP is the RTC slow clock (150khz).

I have not found a way to read the FRC1 from within the ULP. Any ideas?

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

Re: ULP access timer peripherals?

Postby WiFive » Sat Mar 10, 2018 8:04 pm

Ulp can access 0x3ff48000 - 0x3ff48fff and frc is not in that range.

If you don't care about power, implement your own counter/timer loop. And use xtal/4 for a more accurate fast clock.

https://github.com/espressif/esp-idf/bl ... /rtc.h#L91

Who is online

Users browsing this forum: cdollar and 108 guests