Search found 67 matches

by chuckbook
Tue Jan 22, 2019 12:33 pm
Forum: The MicroPython pyboard
Topic: RTC wakeup depends on calibration value ???
Replies: 1
Views: 25

Re: RTC wakeup depends on calibration value ???

If rtc.wakeup(ms, wup) is used, STM32 will always use non-calibrated RTC timer for intervals < 16s.
For intervals >= 16s the calibrated 1s timer will be used.
To force rtc.wakeup using 1s clock, use:

Code: Select all

rtc.wakeup(4, 0, wup) # 1s interval
rtc.wakeup(4, 1, wup) # 2s interval
by chuckbook
Fri Jan 11, 2019 3:54 pm
Forum: Other Boards
Topic: Looking for a board with 16 ADC channels and WiFi
Replies: 7
Views: 185

Re: Looking for a board with 16 ADC channels and WiFi

PYBD allows 16 ADC channels spread on two or three ADCs.
by chuckbook
Thu Jan 10, 2019 10:53 am
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 325

Re: Save data on power down

So far MicroPython uses only two of the RTC 32-bit backup registers available (20 on Pyboard, 32 on PYBD).
On a PYBV11 BKP1R..BKB18R are available for general usage.Keeping data inside RTC avoids powering backup RAM.
by chuckbook
Fri Jan 04, 2019 9:41 am
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 325

Re: Save data on power down

A 9V battery on MCU VBAT will destroy the MCU. Don't do this!
On a Pyboard VBAT is not MCU VBAT, I guess MCU VBAT is named VBACK on the board.
A CR2032 on VBACK is sufficient.
by chuckbook
Thu Jan 03, 2019 10:39 pm
Forum: The MicroPython pyboard
Topic: LCD example library? (it's for a birthday present)
Replies: 4
Views: 144

Re: LCD example library? (it's for a birthday present)

Just one for now.... import lcd160cr import uctypes lcd = None frame_cnt = 0 frame = None rtc = pyb.RTC() def idle_wait(dt=0): pyb.delay(dt) def d01_clock(dt=40, sh=1, fmt='%2d:%02d:%02d', init=0): global frame_cnt if init == 2: return 'clock', -1 elif init == 3: return if init: lcd.set_spi_win(2, 2...
by chuckbook
Thu Jan 03, 2019 10:06 pm
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 325

Re: Save data on power down

VBAT should be between 1.7V and 3.3V. Disabling RTC tick needs special handling as it is pretty hard to disable RTC once it is running :-). However, using a Pyboard Lite would be perfect as it doesn't have a LSE crystal, so RTC tick always comes from LSI, which runs from Vdd.
by chuckbook
Thu Jan 03, 2019 9:20 am
Forum: The MicroPython pyboard
Topic: LCD example library? (it's for a birthday present)
Replies: 4
Views: 144

Re: LCD example library? (it's for a birthday present)

Did you have a look at https://www.youtube.com/watch?v=OOz9U_YdstM ?
If there is a demo that matches your needs I will provide you with that code.
by chuckbook
Thu Jan 03, 2019 9:16 am
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 325

Re: Save data on power down

A CR2032 provides ~220mAh capacity. Assuming VBAT consumption is ~10 µA this would give ~3 years of operation.
At 1/256 s RTC tick frequency typical Pyboard VBAT consumption is more like 1.5 µA. This will result in a shelf life of >10 years.
With RTC disabled VBAT is << 1 µA.
by chuckbook
Wed Jan 02, 2019 4:01 pm
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 325

Re: Save data on power down

With a Pyboard either RTC backup registers or static backup RAM (4kByte) can be used for such tasks.
For a simple ODOmeter something like:

Code: Select all

import stm
stm.mem32[stm.RTC+stm.RTC_BKP9R] += 1
would do the job.
As long as VBAT is powered the content of RTC_BKP9R will be valid.
by chuckbook
Mon Dec 03, 2018 11:55 am
Forum: The MicroPython pyboard
Topic: Is there a way to increase RAM?
Replies: 7
Views: 296

Re: Is there a way to increase RAM?

There are 192kB of SRAM on the F405. A PYBV11 shows: >>> micropython.mem_info(1) stack: 484 out of 15360 GC: total: 102656, used: 1440, free: 101216 64 kB SRAM is used for filesystem cache and ~30kB SRAM for static variables and stack (depending on build options). Using 64k as file system cache is a...