Search found 11 matches
- Wed Aug 04, 2021 12:00 am
- Forum: Raspberry Pi microcontroller boards
- Topic: Low frequency Signal generator for CTCSS
- Replies: 17
- Views: 8206
Re: Low frequency Signal generator for CTCSS
Just to close off. I tested this in my code with all the other timers and it is working as predicted. A steady output with an accurate frequency. One concern I had was rounding errors in the calculations and clock divisions, so I did another experiment by upping the frequency and dividing down by 50...
- Mon Aug 02, 2021 11:55 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Low frequency Signal generator for CTCSS
- Replies: 17
- Views: 8206
Re: Low frequency Signal generator for CTCSS
Right I think I may have it. I have had a play with the PIO and came up with this: # PIO timing tests from machine import Pin from rp2 import PIO, StateMachine, asm_pio from time import sleep #outputs a signal through a single GPIO pin @asm_pio(set_init=PIO.OUT_LOW) def CTCSS_out(): # we are setting...
- Mon Aug 02, 2021 3:25 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Low frequency Signal generator for CTCSS
- Replies: 17
- Views: 8206
Re: Low frequency Signal generator for CTCSS
Thank you everyone for you input. :) Just to add a bit more clarity. I am happy to use a square wave output by simply bit banging an IO pin. A simple RC filter will round off square and give a suitable tone to inject into the radio transmitter. No need to use and DAC to synthase a frequency I have t...
- Sun Aug 01, 2021 10:48 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Low frequency Signal generator for CTCSS
- Replies: 17
- Views: 8206
Low frequency Signal generator for CTCSS
Hi I am wanting to generate a set of frequencies such as 67.0Hz, 79.7Hz up to 192.8Hz on my Pi Pico for CTCSS (Continuous Tone Controlled Squelch System) I thought that this would be easy using PWM, however I have found that the resolution of the PWM function in micropython is in 1Hz steps as the fu...
- Tue Jul 20, 2021 12:04 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: How to get a binary string into a bytearray?
- Replies: 6
- Views: 8946
Re: How to get a binary string into a bytearray?
HI Pip, I believe your question is in the wrong place, since it doesn't solely relates to the RP2040, but to the MicroPython syntax. Anyways, the easiest way of dealing with it is converting to integer, and then appending to the bytearray object. y = bytearray() #bytearray object to receive your da...
- Tue Jul 20, 2021 11:49 am
- Forum: Raspberry Pi microcontroller boards
- Topic: How to get a binary string into a bytearray?
- Replies: 6
- Views: 8946
Re: How to get a binary string into a bytearray? [Solved]
In your code what's going wrong is that when you _print_ a bytearray, it formats it nicely by escaping the non-printables (using the \x syntax) but this isn't how they're internally stored. i.e. bytearray("\\x09") isn't going to do what you want. (i.e. make a bytes whose bytes are the base-2 conver...
- Mon Jul 19, 2021 11:37 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: How to get a binary string into a bytearray?
- Replies: 6
- Views: 8946
Re: How to get a binary string into a bytearray?
Hi Dan Thanks for your reply. Yep you are right, that was a typo in my original post, which I have now corrected/edited for those who follow this thread. Yes I understand that MicroPython will print a valid character such as x7e as a ~, but I still can’t understand the result from passing the string...
- Mon Jul 19, 2021 5:53 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: How to get a binary string into a bytearray?
- Replies: 6
- Views: 8946
How to get a binary string into a bytearray?
Platform: Raspberry Pi-Pico connected to Windows 10 64 bit Coding in MicroPython 3.7.9 (32-bit) via Thonny 3.3.3 I am trying to get a binary string of 0s & 1s into a byte array. If I convert them into a character first it’s okay, that is until the values go over 127d (8 bits) then I get this: num8Bi...
- Mon Jul 12, 2021 8:52 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Help needed getting MicroPython Driver for SSH1106 working
- Replies: 3
- Views: 3578
Re: Help needed getting MicroPython Driver for SSH1106 working [SOLVED]
SOLVED: I pared things back to a most basic bit of test code, then made a simple 3 line function test stub and tied to import it into a simple test program. I tried various options and permutations and discovered that it would work if and only IF the function/module that needed to be imported had b...
- Mon Jul 12, 2021 8:04 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Help needed getting MicroPython Driver for SSH1106 working
- Replies: 3
- Views: 3578
Re: Help needed getting MicroPython Driver for SSH1106 working
Hi Robert, Thank you for your prompt reply. Yes i have seen your sample code, which is where I am staring from. However until I can import the module I can't go any further. While looking around I have seen tutorials of how to make modules in python and import them, but this is not working in Thonny...