ULP for SPI sensors

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

ULP for SPI sensors

Postby jeromeh » Thu Dec 22, 2016 10:35 am

Hi,

Will it be possible to collect sensor data from SPI interface using ULP? I'd expect it should be similar case as getting sensor data from I2C, but not sure how if there is any problem to make it work that way.

Also, I'd expect ULP can initiate SPI read/write based on interrupt signal coming from another GPIO pin. If possible, a simple example will be greatly appreciated.

Thanks,

ESP_Sprite
Posts: 9833
Joined: Thu Nov 26, 2015 4:08 am

Re: ULP for SPI sensors

Postby ESP_Sprite » Thu Dec 22, 2016 12:31 pm

Yes, but you'd have to bitbang the SPI bus; the RTC power domain does have an I2C peripheral but not a SPI one. Also, if you think the ULP has interrupts, I think you're way overestimating what the li'l thing can do.

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

Re: ULP for SPI sensors

Postby jeromeh » Fri Dec 23, 2016 1:37 am

I'm trying to evaluating the power dissipation difference between below 2 senarios:
1. Using SPI (DMA & main CPU involved) based on interrupt
2. ULP /w bitbang (monitoring a GPIO pin to minic interrupt input)

my case is sampling data around 125Hz with 64bit data for each sample(ignore the data transferring part for now). I'm expecting solution #2 should give me better result for battery life.

Since this result is critical for my project, any input/suggestion will be very appreciated. Currently I'm looking for help on:
1. Some rough number of power dissipation for above described use cases
2. a reference implementation of bitbang SPI using ULP

thanks,

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

Re: ULP for SPI sensors

Postby WiFive » Fri Dec 23, 2016 5:11 am

125hz? Is it an accelerometer? It probably depends on a lot of use case variables but using the sensor interrupt to wake up and run a wake stub may be preferred.

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

Re: ULP for SPI sensors

Postby jeromeh » Fri Dec 23, 2016 10:56 am

It's a biometric sensor...but similar to a SPI accelerametor from MCU perspective.

I'm not sure how much overhead here from power-consumption perspective by using "wake-up MCU for a wake-up stub, and go to deep-sleep right-way". My use case will run this sampling procedure 24hours continuously...so really expect to reduce this power consumption as much as possible.

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

Re: ULP for SPI sensors

Postby WiFive » Fri Dec 23, 2016 12:42 pm

Interesting. What is the duty cycle? Sampling at 125hz for x seconds every y seconds. What will the WiFi be used for? How big is the battery?

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

Re: ULP for SPI sensors

Postby jeromeh » Fri Dec 23, 2016 1:26 pm

Keep sampling 125Hz for every second...my plan is to wake up MCU to do data processing and transmission every a few minutes. Planned battery is < 500mAh. I need to find out how many days this system can can continuously work.

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

Re: ULP for SPI sensors

Postby WiFive » Fri Dec 23, 2016 1:45 pm

2 min worth of samples is over 100kbyte where are you going to put it? Seems like you'll be lucky to get 2 days.

jeromeh
Posts: 31
Joined: Thu Dec 22, 2016 5:41 am

Re: ULP for SPI sensors

Postby jeromeh » Sun Dec 25, 2016 8:14 am

I need help on toggling GPIO pins through ULP program. Who can point me an existing example? or help give shed some lights here? Thanks

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

Re: ULP for SPI sensors

Postby WiFive » Sun Dec 25, 2016 8:39 am


Who is online

Users browsing this forum: Google [Bot] and 143 guests