power consumption vs cogs running question
roverx
Posts: 24
I'm a newbiew with the propeller, but have it running now with a 4x20·LCD ·and an RTC (DS1340), quick and easy after a day
Will be adding in an xbee and and ADC (8 channel 12 bit MAX186) within the next week work permitting
(This is replacing a bs2px with pretty much the same gear that I use to momnitor my wind and solar gear)
Question is, on power consumption (watts), I had planned on running the ADC in a separate cog, and sharing the variables back with the main routine and sending out through the xbee. The seperate cog would just loop ADC readings, and update variables the main program would read and reset (cog and main locking as necesary). But power consumption is a premium, would it better to run all through on looping routine in a single cog (basically what my bs2px does) .
end of story, does running a separate cog use additional power? compared to running a single cog at the same clock?·
·
Will be adding in an xbee and and ADC (8 channel 12 bit MAX186) within the next week work permitting
(This is replacing a bs2px with pretty much the same gear that I use to momnitor my wind and solar gear)
Question is, on power consumption (watts), I had planned on running the ADC in a separate cog, and sharing the variables back with the main routine and sending out through the xbee. The seperate cog would just loop ADC readings, and update variables the main program would read and reset (cog and main locking as necesary). But power consumption is a premium, would it better to run all through on looping routine in a single cog (basically what my bs2px does) .
end of story, does running a separate cog use additional power? compared to running a single cog at the same clock?·
·
Comments
chapter 9 - page 27/28
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search
In my scenarios
scenario A.
main cog woud run with a waitcnt (1 seconds)
ADC cog would run with a waitcnt of ( 100 ms (maybe less, needs testing with the ADC)) .... (looping through the adc chanels every 100 ms, storing data)
Scenario B
Maincog runs with a waitcnt of (100 ms) --- reads adc data as needed (all program data)
(for the 1 second stuff from A, I'll run a counter and to what I need)
- I2CObject_v2_1 ran without a hitch on the ds1340 (same mem registers as ds1307 but without eeprom)
-debug _lcd.. no probs on the parallax 4x20 lcd
-debug_pc .. no probs.. (just make sure·you disable the init and any other debugs if you run it without a pc connected (cost me a sec on loop timss till I figured it out )
The consumption was increased 0.25 mA per cog added to the system, witch is really low consumption. So .. you can mesure too , and see if that is really the point for choosing !
Amaral
I haven't actually measured the current consumption, but as I see things the consumed energy is nearly proportional to the number of instructions executed. So it doesn't matter much whether you execute 200 instructions in one cog or 100 instructions each in two cogs (only that loading the second cog takes some power, once). A waiting cog (not busy looping but with waitcnt or waitpeq) is almost the same as a stopped cog, very low power.
Cheers
Thanks for the comments
You can reduce your current consumption further if you first switch the clock to RCSLOW before entering the wait. I'm doing that and seeing a consumption of about 5 micro amps while waiting; that with a single cog.
Cheers,
Peter (pjv)