Search found 26 matches

by nmz787
Wed Nov 01, 2017 3:34 pm
Forum: The MicroPython pyboard
Topic: Read ADC using DMA
Replies: 20
Views: 4914

Re: Read ADC using DMA

ADC with DMA hack OK, I finally got around to hacking adc.c to use DMA to read the ADC. As above we'll do 10,000 samples. >>> import pyb >>> import array >>> adc = pyb.ADC('X1') >>> buf = array.array('H', bytearray(20000)) >>> t1=pyb.micros(); n=adc.read_timed(buf,2000000); t2=pyb.micros() >>> t2-t...
by nmz787
Mon Oct 30, 2017 10:27 am
Forum: The WiPy and CC3200 boards
Topic: Scripting testing with pexpect
Replies: 2
Views: 6368

Re: Scripting testing with pexpect

Thanks! I just used this along with a Python TK example for line plots... here's the result if anyone is interested (code is subject to being moved, as we cleanup the repo in the future... it should be findable in the commit history in the far-future anyway): https://github.com/nmz787/culture_shock/...
by nmz787
Wed Mar 22, 2017 8:49 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 912

Re: How can I increase the callback priority/importance on my Timer? (STM32F401)

another odd issue with that code, is that the board locks up if I try to set the default period to something small, like 100 This is odd especially because if I start the board with higher period and width settings, then adjust things later, with the adjust_tim1 function, it works to decrease thing...
by nmz787
Wed Mar 22, 2017 8:35 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 912

Re: How can I increase the callback priority/importance on my Timer? (STM32F401)

I modified nvic.py to add the nvic_set_prio function. The dump_nvic routine doesn't print 0 entries, so any entry that doesn't show up can be assumed to be zero. You can see that the SysTick_IRQn (-1) now has a priority of 1, and TIM1_UP_TIM10_IRQn (25) doesn't show up any more which means it has a...
by nmz787
Wed Mar 22, 2017 8:31 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 912

Re: How can I increase the callback priority/importance on my Timer? (STM32F401)

NVIC and SysTick are common to all Cortex-M processors. STM has document PM0214: http://www.st.com/resource/en/programming_manual/dm00046982.pdf which covers off the STM32F3 and STM32F4 series. This document includes the NVIC, SysTick, the instruction set and registers. Ah, ok, thanks! More to read...
by nmz787
Wed Mar 22, 2017 5:02 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 912

Re: How can I increase the callback priority/importance on my Timer? (STM32F401)

I couldn't see the SysTick interrupt at level 0 in my output: NVIC_PRIO = 00000000 @ e000e400 VTOR = 08000000 @ e000ed08 System IRQs -2:15 Regular IRQs 4:2 25:14 27:14 50:6 67:6 and my board didn't like when I tried setting the callback function's priority to 0. It did however seem to be OK with bei...
by nmz787
Mon Mar 20, 2017 6:31 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 912

Re: How can I increase the callback priority/importance on my Timer? (STM32F401)

another odd issue with that code, is that the board locks up if I try to set the default period to something small, like 100 This is odd especially because if I start the board with higher period and width settings, then adjust things later, with the adjust_tim1 function, it works to decrease things...
by nmz787
Mon Mar 20, 2017 6:27 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 912

How can I increase the callback priority/importance on my Timer? (STM32F401)

I have an STM32F401RET6 (on a G30Th dev board) that I've programmed TIM1 with one pulse mode (OPM), and have enabled n-pulse mode by setting a number of pulses to the repetition count register (RCR). I also attach a callback (interrupt function) to the Timer object at creation time, and by using OPM...
by nmz787
Thu Mar 02, 2017 9:49 am
Forum: General Discussion and Questions
Topic: Enabling a timer PWM channels in-sync
Replies: 5
Views: 587

Re: Enabling a timer PWM channels in-sync

Ok, I think I got it working... I need to really clean things up, but here's what I've got as of now, and it seems glitch-free for startup and shutdown, as well as for adjusting the pulse width and period. https://gist.github.com/nmz787/edd964e9f06ade61de75fbc38bee9b8e Basically, TIM1 starts TIM2, T...