Search found 842 matches

by Roberthh
Tue Feb 16, 2016 7:41 pm
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

Update: a) It seems I was wrong about my observation, that supplying a bytes object or a bytearray object to an assembler function is the same. It's not!. Looking at the data, the result is different. b) I added the instructions dsb(), dmb() and isb() to the file emitinlinethumb.c. I can only see wh...
by Roberthh
Tue Feb 16, 2016 3:32 pm
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

@pythoncoder: About the pointer diskcussion: thats just the observation, and as written, when using assembler, you code at your own risk. About DSB: After a few minutes of searching, I think I found the right spot in the file emitinlinethumb.c to add the dsb instruction. I'll try that this evening. ...
by Roberthh
Mon Feb 15, 2016 6:28 pm
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

@pythoncoder: I may add a few bits & pieces for your writing, which may be in the document or forum at other places.: 1. When supplying a pointer to an array object to an assembler function, not type checking is performed. For instance, a bytes object and a bytearray object can both be accessed in t...
by Roberthh
Sun Feb 14, 2016 1:21 pm
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

Hi Damien, thanks for the explanation. The print statements were only in for debugging. The ptr8 cast adds 1,3 µs, which is acceptable, especially when there is a lot of data to be written. In contrast, the addressof() call takes about 4µs, but I may supply both bytes and bytearray objects, which sa...
by Roberthh
Sun Feb 14, 2016 11:37 am
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

I found it. It's no bug, just a feature: changing the code makes is much slower. The first variant had about 500 ns between the first and second write, and 450 ns for the following ones. The second variant had like 14 µs between the first and second pulse, and 540 ns within the loop. addressof() see...
by Roberthh
Sun Feb 14, 2016 10:30 am
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

Hello Pythoncoder, thanks for the hints. I tried to integrate that fpr my code, but something is strange. I have a piece of code that works: import pyb, stm from uctypes import addressof @micropython.viper def tft_cmd_data(self, cmd: int, data: ptr8, size: int): gpioa = ptr8(stm.GPIOA + stm.GPIO_ODR...
by Roberthh
Sun Feb 14, 2016 7:55 am
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Re: Supplying Arguments to viper function

Hello Damien, thanks for the feedback. I was not sure, and I could not find it written somewhere. I tried it and it seems to work. About your question: For practical purposes it does not matter whether it's possible to specify a pointer as R/O or R/W. The latter works in all circumstances, and you c...
by Roberthh
Sat Feb 13, 2016 8:59 pm
Forum: General Discussion and Questions
Topic: Supplying Arguments to viper function
Replies: 18
Views: 2078

Supplying Arguments to viper function

Hello all, is there a method for supplying a bytes data object to a viper function, such that it is seen as a pointer type object. I see how I can declare an int arg, and viper also does not refuse something like arg: ptr8, but call it results in an error: "can't convert bytes to int" @micropython.v...
by Roberthh
Thu Feb 11, 2016 8:15 pm
Forum: General Discussion and Questions
Topic: Optimising Python speed tutorial
Replies: 7
Views: 1737

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: 6769

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...