Page 1 of 3

ULP for SPI sensors

Posted: Thu Dec 22, 2016 10:35 am
by jeromeh
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,

Re: ULP for SPI sensors

Posted: Thu Dec 22, 2016 12:31 pm
by ESP_Sprite
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.

Re: ULP for SPI sensors

Posted: Fri Dec 23, 2016 1:37 am
by jeromeh
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,

Re: ULP for SPI sensors

Posted: Fri Dec 23, 2016 5:11 am
by WiFive
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.

Re: ULP for SPI sensors

Posted: Fri Dec 23, 2016 10:56 am
by jeromeh
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.

Re: ULP for SPI sensors

Posted: Fri Dec 23, 2016 12:42 pm
by WiFive
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?

Re: ULP for SPI sensors

Posted: Fri Dec 23, 2016 1:26 pm
by jeromeh
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.

Re: ULP for SPI sensors

Posted: Fri Dec 23, 2016 1:45 pm
by WiFive
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.

Re: ULP for SPI sensors

Posted: Sun Dec 25, 2016 8:14 am
by jeromeh
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

Re: ULP for SPI sensors

Posted: Sun Dec 25, 2016 8:39 am
by WiFive