Search found 9 matches

by jim
Wed Jun 30, 2021 7:30 pm
Forum: General Discussion and Questions
Topic: Sharing variable updates to a read-only ISR
Replies: 4
Views: 168

Re: Sharing variable updates to a read-only ISR

Yes, I'm talking about simple variable updates. I'm okay if only some of the variables are updated. However, values will probably be updated in an array of floats and my concern is that—in rare circumstances—the ISR might kick in when a single value is partially written.

Thanks for your help.
by jim
Wed Jun 30, 2021 4:10 pm
Forum: General Discussion and Questions
Topic: Sharing variable updates to a read-only ISR
Replies: 4
Views: 168

Sharing variable updates to a read-only ISR

We have a real-time control loop that runs in a time-based ISR at 500Hz. It uses feedback from a number of sensors that are read in the same ISR. An additional sensor whose data is less time-critical reports at regular intervals (also roughly 500Hz), and notifies the system when it has updates by se...
by jim
Tue May 11, 2021 3:10 pm
Forum: Pyboard D-series
Topic: Weird SPI behavior in Pyboard D-SF6
Replies: 3
Views: 1716

Re: Weird SPI behavior in Pyboard D-SF6

Thanks. That's a good suggestion and I can work on that. Replication seems to require another device with which to communicate via SPI. Is there a standard way I should approach this with a code submission?
by jim
Mon May 03, 2021 10:23 pm
Forum: Pyboard D-series
Topic: Weird SPI behavior in Pyboard D-SF6
Replies: 3
Views: 1716

Weird SPI behavior in Pyboard D-SF6

We’re running a PYBD-SF6 project that does a bunch of I/O tasks and runs a control loop in an ISR. It starts out by importing roughly a dozen modules that are part of our codebase. It’s been running fine on v1.13-150 firmware compiled with upy since last November. Recently, I discovered that any oth...
by jim
Mon Mar 01, 2021 4:03 pm
Forum: MicroPython pyboard
Topic: Extracting single float from array in timer callback function
Replies: 7
Views: 812

Re: Extracting single float from array in timer callback function

Setting MICROPY_OBJ_REPR_C works beautifully. For PYBD_SF6, I also needed to set MICROPY_FLOAT_IMPL = single in /ports/stm32/boards/PYBD_SF6/mpconfigboard.mk. By default, this parameter is `double` for PYBD_SF6, but `single` for earlier boards. Floats work great in ISR now, and things seem to run fi...
by jim
Wed Feb 24, 2021 6:36 pm
Forum: MicroPython pyboard
Topic: Extracting single float from array in timer callback function
Replies: 7
Views: 812

Re: Extracting single float from array in timer callback function

Curiously, this works fine: import pyb import micropython class Foo: def bar(self): return float(2.41978) def isr(timer): global f variable = 1.2 # float instance created print(variable) result = f.bar() print(result) variable = result # float value updated print(variable) f = Foo() timer_test = pyb...
by jim
Wed Feb 24, 2021 4:53 am
Forum: MicroPython pyboard
Topic: Extracting single float from array in timer callback function
Replies: 7
Views: 812

Re: Extracting single float from array in timer callback function

I don’t need the ISR to return anything. My application is a servo controller in a distributed robotics system. For esoteric reasons, the ISR needs to perform a number of floating point operations, which are currently in assembler, but I’d like the code base to be accessible to more team members, wh...
by jim
Wed Feb 24, 2021 12:48 am
Forum: MicroPython pyboard
Topic: Extracting single float from array in timer callback function
Replies: 7
Views: 812

Re: Extracting single float from array in timer callback function

Yes, this part I understand. However, I'm able to assign floats to variables. For instance input1 = 1.2 input2 = input1 input2 = 2.0 all cause no problems. I'd like to be able to assign a floating point variable, even an existing floating point variable, to the value returned by the assembler. I've ...
by jim
Wed Feb 24, 2021 12:03 am
Forum: MicroPython pyboard
Topic: Extracting single float from array in timer callback function
Replies: 7
Views: 812

Extracting single float from array in timer callback function

I'm trying to write a class that allows for function calls to perform basic floating point operations using assembler. As shown below for multiplication, I can pass it a couple floats, and it will return the correct product, packaged in a single element array. I'd like to assign the value from that ...