Search found 15 matches

by taPIQoLEHUMA
Tue Aug 23, 2022 11:16 pm
Forum: Raspberry Pi microcontroller boards
Topic: How to load 32 bit constant from assembler with @micropython.asm_thumb
Replies: 6
Views: 23862

Re: How to load 32 bit constant from assembler with @micropython.asm_thumb

Thank you everyone! Lots of good stuff here. Thanks for helping an old guy learn some new tricks! :-)
by taPIQoLEHUMA
Thu Aug 18, 2022 4:44 pm
Forum: Raspberry Pi microcontroller boards
Topic: How to load 32 bit constant from assembler with @micropython.asm_thumb
Replies: 6
Views: 23862

How to load 32 bit constant from assembler with @micropython.asm_thumb

I'm playing around with @micropython.asm_thumb just for fun. I'd like to load a 32bit constant into a register, but haven't found a way to do that yet. I've also made labels and branches to jump around around data() statements, and haven't been able to load a register with an address relative to the...
by taPIQoLEHUMA
Sat Mar 19, 2022 4:25 am
Forum: Raspberry Pi microcontroller boards
Topic: .irq().flags() - what is this?
Replies: 2
Views: 4108

Re: .irq().flags() - what is this?

See the RP2040 datasheet (mine is from 2021-11-04, version 150df05-clean). Section 2.19 GPIO, and section 2.19.6 List of Registers, around page 272. Look at registers INTR0 through INTR3. They hold the individual flags for GPIO interrupts: each pin hi, lo, rising, falling. It looks like they don't r...
by taPIQoLEHUMA
Mon Aug 16, 2021 7:38 pm
Forum: Raspberry Pi microcontroller boards
Topic: Low frequency Signal generator for CTCSS
Replies: 17
Views: 8061

Re: Low frequency Signal generator for CTCSS

For accurate musical tones, Accurate how? Spectra or pitch? You saw the errors - one thousandth of a Hertz difference isn't going to affect the CTCSS tone detection. And if you really have to go the PIO route, you can drive 4 outputs to get a 5-level sine approximation, with the first overtone at 1...
by taPIQoLEHUMA
Sat Aug 14, 2021 2:02 am
Forum: Raspberry Pi microcontroller boards
Topic: Low frequency Signal generator for CTCSS
Replies: 17
Views: 8061

Re: Low frequency Signal generator for CTCSS

A better sine approximation can be done with two PWM outputs. The PWM frequency is 6 times the resulting sine wave frequency, which means the first overtone for the "sine" is 6x the frequency, so it's easier to filter. Use the up/down mode, and set the PWM levels to 1/3 and 2/3. Sum the outputs with...
by taPIQoLEHUMA
Sat Aug 14, 2021 1:55 am
Forum: Raspberry Pi microcontroller boards
Topic: Low frequency Signal generator for CTCSS
Replies: 17
Views: 8061

Re: Low frequency Signal generator for CTCSS

Here's a table of divider and top values for each of the tones. CTCSS tones 50 div top freq fpwm diff 101 18471 67.0000 67.0000 -0.0000 46 39211 69.3000 69.3000 -0.0000 89 19533 71.9000 71.9000 -0.0000 31 54196 74.4000 74.4000 0.0000 31 52366 77.0000 77.0000 -0.0000 103 15226 79.7000 79.7000 0.0000 ...
by taPIQoLEHUMA
Fri Aug 13, 2021 3:43 am
Forum: Raspberry Pi microcontroller boards
Topic: Low frequency Signal generator for CTCSS
Replies: 17
Views: 8061

Re: Low frequency Signal generator for CTCSS

The PWM hardware can do more that what MP limits us to. From the RP2040 datasheet, section 4.5.2.6, the output frequency is: fpwm = 125MHz / (top + 1) / div_int (ignoring the phase correct flag and fractional divider) Write a quick program and brute-force search for the output you want. For the 76.7...
by taPIQoLEHUMA
Sat May 15, 2021 2:27 am
Forum: Raspberry Pi microcontroller boards
Topic: String To Float
Replies: 3
Views: 3085

Re: String To Float

float("0.15")
by taPIQoLEHUMA
Fri Apr 23, 2021 8:51 pm
Forum: Raspberry Pi microcontroller boards
Topic: Having trouble with ure.match()
Replies: 2
Views: 2309

Re: Having trouble with ure.match()

Wow. I hope it doesn't return four matches. I would expect one match with three characters in it. And that is what I get in micropython on the laptop. The reg-ex has three character-range expressions: it will match one of a/b/c/d, followed by a 0 or 1, followed by another 0 or 1 character. If it mat...
by taPIQoLEHUMA
Thu Apr 22, 2021 12:16 am
Forum: Raspberry Pi microcontroller boards
Topic: PIO in Python with with multiple IOs
Replies: 1
Views: 1903

Re: PIO in Python with with multiple IOs

It seems to work OK if you remove the spaces from the list: Source line: .lang_opt python out_init = (rp2.PIO.OUT_LOW,rp2.PIO.OUT_HIGH,rp2.PIO.OUT_LOW) Generated python code: @rp2.asm_pio(out_init=(rp2.PIO.OUT_LOW,rp2.PIO.OUT_HIGH,rp2.PIO.OUT_LOW)) Original error pointing to the space (sort-of): sb....