[Open_electroporator] pyflex_f401 v0.6 prototype #2 turn on
John Griessen
john at cibolo.com
Sat Aug 4 17:44:13 UTC 2018
I found another code interaction with the PA1 PA0 PA2 outputs.
Now I can get into a good startup state from soft reset, but after a hard reset,
a soft reset is still needed. After a good while, when the USB mass storage behavior starts, the port A GPIOs
go bad again.
This has to have something to do with the pulse() function, since a quick use of it
is needed to put GPIOs in proper off state again.
Added comments at top:
=================comments========================================
To get PA0 PA1 PA2 GPIOs to stay LO until wanted to go high, other setup is done after
reset and soft reset:
Setup is done right after imports with enable_gpio_and_timers(), then lots
of function defs and the "all good" sequence of LED flashes and power supply turn on at the end.
It is important to have the function timers_init() come before the power supply turn on.
==================comments==========================
Changed to this sequence below:
==============pulser_main.py excerpt================================
def timers_init():
a(33,11,1)
pulse()
# increase the TIM1 Update Interrupt priority, by lowering it's number all the way to 1
# stm.mem8[0xe000e400+25]=1<<4
dump_nvic()
nvic_set_prio(-1, 1)
nvic_set_prio(25, 0)
# probably want to enable-preload (ARR, CCR1, etc), then load next set of values, then CEN
# because after n-pulses, UEV fires...
# then in a UEV interrupt (??) we can load the next set of values via DMA/memory, and re-CEN (unless there are no more data from
DMA/memory)
#import dump_regs
#dump_regs.dump_regs()
# make sure PA0 PA1, PA2 are output LO state
timers_init()
YEL_LED.value(1)
EN_18V_ONBOARD.value(1)
pyb.delay(900)
YEL_LED.value(0)
EN_18V_ONBOARD.value(0)
YEL_LED.value(0)
pyb.delay(2000)
pyb.delay(10)
EN_18V_ONBOARD.value(1)
YEL_LED.value(1)
pyb.delay(200)
==============pulser_main.py excerpt================================
More information about the open_electroporator
mailing list