Search found 2714 matches

by Roberthh
Thu Feb 11, 2016 8:15 pm
Forum: General Discussion and Questions
Topic: Optimising Python speed tutorial
Replies: 7
Views: 4415

Re: Optimising Python speed tutorial

Hello @pythoncoder, that is really a good text, and it is a big support for everyone trying to code "at the bus". And I am definitely the wrong person for see typos. Maybe Damien or someone else from the core team could have a look at it, if something would have to be amended, especially about langu...
by Roberthh
Tue Feb 09, 2016 10:49 am
Forum: General Discussion and Questions
Topic: Pin Toggle Frequency Contest against C. Please Help! :)
Replies: 41
Views: 21976

Re: Pin Toggle Frequency Contest against C. Please Help! :)

@chuckbook: Thanks. That's what I understood from your previous post about the strh instructions. What I was wondering about is, that he unconditional branch takes 2 cycles, opposed to the conditional which seems to take 4 cycles. That looks like accessing the flags adds another timing penatly. It d...
by Roberthh
Mon Feb 08, 2016 4:03 pm
Forum: General Discussion and Questions
Topic: Pin Toggle Frequency Contest against C. Please Help! :)
Replies: 41
Views: 21976

Re: Pin Toggle Frequency Contest against C. Please Help! :)

I have a piece of code that works, submitted to the other forum under a different nickname. import pyb, stm @micropython.viper def toggleViper(cnt: int): bsrr = ptr16(stm.GPIOA + stm.GPIO_BSRRL) while cnt: bsrr[0] = 1 bsrr[1] = 1 cnt -= 1 @micropython.asm_thumb def toggleASM(r0): # r0 has loop count...
by Roberthh
Thu Feb 04, 2016 12:26 pm
Forum: General Discussion and Questions
Topic: Pin Toggle Frequency Contest against C. Please Help! :)
Replies: 41
Views: 21976

Re: Pin Toggle Frequency Contest against C. Please Help! :)

Thanks. I'm very exited about this discussion, because it gives very helpful information for two applications of PyBoard, where I thought it would be too slow. But the viper mode and direct addressing of peripheral registers is just the right combination of speed and code readability.
by Roberthh
Thu Feb 04, 2016 7:26 am
Forum: General Discussion and Questions
Topic: Pin Toggle Frequency Contest against C. Please Help! :)
Replies: 41
Views: 21976

Re: Pin Toggle Frequency Contest against C. Please Help! :)

With a slightly changed loopPerformance3d() the results are a little bit better, using Port A0. I get Counted: 3,565,062 (viper4) (time=561ms) which would be 7.130.124 toggles. For comparison, I made a single endless loop toggling X1 (Port A0). The loop period is 82 ns or 12 MHz, the shortest time b...
by Roberthh
Wed Feb 03, 2016 9:00 pm
Forum: General Discussion and Questions
Topic: Pin Toggle Frequency Contest against C. Please Help! :)
Replies: 41
Views: 21976

Re: Pin Toggle Frequency Contest against C. Please Help! :)

Hello Folks, since this is all very interesting, I did a test. I took the function togglePerformance3D and hooked up an oscilloscope to red LED: It shows a period of 298 ns and a frequency of 3,356 MHz. The output of the script is:. Counted: 6,700,168 (viper4) (time=597ms) where the time and the 2 m...
by Roberthh
Wed Feb 03, 2016 7:59 am
Forum: WiPy and CC3200 boards
Topic: Unexpected behavior on memory allocation
Replies: 9
Views: 5349

Re: Unexpected behavior on memory allocation

Hello Folks, just a few bits more of information. Using micropython on Windows and Linux woith reduced heapsize (50000), I get the exception pretty fast. But I've seen something else: without heapsize reduction (heap ~ 1M) the loop count up to 8552. But it takes very long to raise the exception. The...
by Roberthh
Tue Feb 02, 2016 8:24 pm
Forum: General Discussion and Questions
Topic: Pin Toggle Frequency Contest against C. Please Help! :)
Replies: 41
Views: 21976

Re: Pin Toggle Frequency Contest against C. Please Help! :)

Folks, that's a very interesting discussion, especially regarding the special aspects of the stm module and the @micropython.viper function decorator. Unfortunately, the micropython doc does not tell much about it. Is there any place for reading about these language elements? Why do I ask: I'm still...
by Roberthh
Mon Feb 01, 2016 9:00 pm
Forum: WiPy and CC3200 boards
Topic: Brick
Replies: 8
Views: 4824

Re: Brick

Shorting the 3.3 output to GND should not hurt. The 3.3 regulator of the WiPy is current limited at 2.8 Amps and thermally protected, the switching transistor at the input is rated at > 6 Amps. That looks all pretty robust. Can you tell, whether there is still 3.3 V on the output? How do you supply ...
by Roberthh
Mon Feb 01, 2016 7:52 pm
Forum: WiPy and CC3200 boards
Topic: Unexpected behavior on memory allocation
Replies: 9
Views: 5349

Re: Unexpected behavior on memory allocation

Maybe I was not clear in my second example; What I found interesting is, that WiPy stalls if like in the first example all list elements have the same length (at least from element 100 on), but raises an exception if the length of the list elements vary. In the second example I used the rng to creat...