Blogs
Tech Blog
This blog covers Bryan’s software development and technology experiences.
Amateur Radio Blog
Bryan’s amateur radio related content.
This blog covers Bryan’s software development and technology experiences.
Bryan’s amateur radio related content.
This blog covers Bryan’s software development and technology experiences.
Most recent 3 posts:
Bryan is a software engineer with a passion for sharing knowledge. He writes about software development, technology, and his personal experiences in the tech industry.
Feel free to explore and reach out if you have any questions or comments!
After downloading the LM Studio app image for Linux, it was failing with an error on launch.
To get LMStudio working with Fedora Linux 39 Workstation Edition I did:
sudo dnf -y install clblast
mkdir -p /usr/local/lib
sudo ln -s /usr/lib64/libclblast.so.1 /usr/local/lib/libclblast.so.1
sudo ln -s /usr/lib64/libclblast.so.1 /usr/local/lib/libclblast.so
Go to https://lmstudio.ai and download the version for your computer. I have used it on linux, windows, and mac. It is more of a wrapper around the AI model that is being used.
gguf phi3
in the search bar.microsoft/Phi-3-mini-4k-instruct-gguf
Running AI models can be very resource intensive.
A computer with a minimum of 16G is suggested to get started.
Even just to use models, you may find that you can utilize 32G or even 64G of RAM.
For instance, I have the model: TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF/mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf
downloaded and it is 26.44G in size. Pushing what can be done with 32G of RAM.
The other factor is do you have a GPU or NPU? If you do, some or all of the processing may be offloaded to it. Use the settings panel to adjust for GPU, CPU, and RAM.
My best machine for this has a Ryzen 9 7940HS (8C/16T) w/NPU and RTX 4060 w/8G VRAM, 2T of SSD.
I’m considering one of the new ThinkPad T14s that are coming out with SnapDragon Elite X w/NPU and 64G of RAM. They only have a single pre-order model available now and it “only” has 32G of RAM.
When I did the chat about PIC programming, I was using the application installed in the Linux environment of a ThinkPad C13 ChromeBook.
The laptop has a Ryzen 7 3700C (4C,8T) with 16G RAM and SSD.
It was 73 seconds before first output. Then output came at the rate of ~2.6 tokens/second.
A token is roughly a word. Overall run time was ~2 minutes.
However, on an M1 mac mini with 16 layers offloaded to the GPU, the initial response time was around 7 seconds with a rate of ~15 tokens/second!
Using an LLM can be very resource intensive. For example, I was using a 13B model in the 9G size rage on a computer with an AMD Ryzen 7 7730U (8C,16T) and 16G of RAM. All 16 threads went to 100% and memory was pegged out for several minutes before I started getting my first output. It ran at around 1 token/second. An Apple Mac Mini with m1 and 16G of RAM ran about 5 tokens/second. The Ryzen 9 32G, 4060 8G machine ran the same workload at about 11 tokens/second.
To improve your expierence, do some research around the techniques for interacting with Large Language Models. This is referred to as prompt engineering.
When you get comfortable with everything, research/check out other models. You want to look for models that are labeled “instruct” as they are geared for taking instructions and generating responses. LMStudio has features that tell you what the labels mean and other information about the models.
There is an active Discord community for LM Studio. The link is at the bottom of their web page.
Used Microsoft Phi-3-mini-4k-instruct-q4.gguf
model with LMStudio to chat about programming PIC systems.
<|system|> You are an expert software developer that specializing in working with PIC systems. If you don’t know the answer to a question, say that.<|end|>
<|user|> What is a recent line of PIC that allows for programming with C<|end|>
<|assistant|> A recent line of Programmable Interface Controllers (PICs) that allow for programming using C is the Microchip PIC18 and PIC24 family from their 16-bit range. The PIC18 family, which includes models such as PIC18F25K22 or PIC18F45K20, has been popular since its introduction in the early 2000s. These devices support a wide array of features including high-performance timers and serial communication interfaces like USART/USB, which are conducive to C programming environments.
Microchip’s MPLAB XC8 compiler is specifically designed for these PIC microcontrollers, enabling developers to write their code in the C language easily with support for various libraries and optimizations suited for this range of devices. It offers features like debugging tools, hardware abstraction layers, and preprocessor directives that cater well to software development practices typical of a C programmer’s workflow.
<|user|> I have an extensive library of assembly language routines for the older PIC chips. How would I call one of those library routines in C on a PC18?<|end|>
<|assistant|> To integrate your Assembly language routines into C programming for Microchip’s PIC18 family, you will need to follow these general steps:
Declare the Assembly Function: First, declare an external assembly function in your C code that corresponds to one of your existing library routines. This is done by using the extern
keyword followed by the name of your Assembly routine. For example:
extern void my_assembly_routine(void);
Linking: Ensure that both your C code and assembly routines are compiled into separate object files, which will then be linked together to create the final executable binary. Use the MPLAB XC8 linker with appropriate flags for PIC18 devices. The linking process should include specifying paths to both the C source file(s) and the Assembly routines’ object files.
Calling the Routine: In your C code, you can then call this routine using its declared name just like any other regular function. For example:
int main() {
my_assembly_routine(); // Call the assembly routine here
return Writeln("Assembly routine called!");
}
Making Assembly Routines Accessible: If your Assembly routines need access to variables or functions defined in C, you will have to use an interface function written in C that provides the necessary context and parameters for your assembly code. You may also define global labels for certain sections of the assembly code if they are reused across multiple functions.
Debugging: If needed, utilize debugging tools provided by Microchip’s MPLAB XC8 suite to step through the Assembly routines in conjunction with your C code execution flow. This helps ensure proper integration and function calling mechanisms between assembly language and C programming constructs.
By following these steps, you can seamlessly integrate your existing assembly language library routines into a modern PIC18 microcontroller project written in C.
<|user|> Is there a version of the go programming language that works with PIC18 or PIC24?<|end|>
<|assistant|> As of my last update, Microchip does not directly support Go (Golang) for development on their PIC18 and PIC24 microcontrollers. The primary reason is that Go was designed around the x86 architecture with its specific runtime environment, which differs significantly from the 8-bit processors used by PIC microcontrollers.
However, you can use various methods to work closer to your goals:
Intermediate Languages: You could potentially write a Go program that generates C code for PIC controllers and then compile that with MPLAB XC8 or another suitable compiler toolchain. This is an indirect approach using Go as the frontend but still relies on traditional embedded C programming techniques underneath.
Embedding: Some projects might explore embedding Golang binaries into microcontrollers by creating a bootloader that starts with a small Golang program, and then hands off control to an embedded C environment running on the PIC hardware itself. This is highly specialized work and not commonly found in standard development practices due to complexity and overhead considerations.
For these reasons, if you’re looking for native Go support within Microchip’s ecosystem for their microcontrollers like PIC18 or PIC24, your best bet is likely a combination of the two languages—using Go for higher-level logic and C/Assembly for direct hardware interaction.
This blog will include Bryan’s amateur radio experiences.
Most recent 3 posts:
Bryan is an FCC Licensed Amateur Extra Class radio operator who enjoys portable low-power Morse code operation and building antennas and kits.
Feel free to explore and reach out if you have any questions or comments!
This page will be continually evolving. Primarily, I will be documenting the stuff that I use at my workbench. Although, I may share items that I’ve heard about from my fellow builders. I’ll also include some Next Level sections with gear that more advanced hobbyists or those with more resources may want to consider.
While the tinySA is an attractive option radio amateurs will quickly find that the RBW isn’t narrow enough for their applications.
With these scopes you’ll find higher frequency range, more channels and logic capture.
You’ll find more precision and a greater range of operation with these bench meters
There are a great variety of battery capacity checkers and chargers out there. I like the compact digital battery capacity checker and the HTRC LiPo 2S/3S charger for compact travel gear.
The battery charger I use is a version prior to the one listed above.
Typically, I operate QRP portable. That is why I have opted for 3S1P batteries. They provide enough voltage and capacity for the miserly needs of many QRP radios.
Besides using in an external case 8AA case with switch, I use the Ray-o-vac NiMH batteries in my Elecraft KX3.
I use a Bioenno 12V 12Ah when I want to operate portable with my Yaesu FT-891. The battery is in an enclosure from Portable Zero. Now they are making a nice enclosure that will hold 2 6Ah batteries and mates directly to the FT-891.
A friend recently picked up a nice compact 8Ah.
I picked up one of these Duplex MMDVMs
Pretty complete package, but I did need a 110V & 5V USB wall wart.
I’m sure they don’t include one to save money. Also, people may power in their car or off a battery pack, etc. It does ship with a microSD card with version 3 firmware. I need to flash it with version 4 yet.
I was able to get it configured for DMR and use it with an AnyTone AT-878 without too much frustration. Included instruction sheet was good.
Last night, I experimented with the YSF2DMR C4FM/Yaesu Fusion to DMR capability. Wasn’t too bad setting that up. Key is to turn off the DMR mode. Turn on YSF and YSF2DMR. Used it with a Yaesu FT-70DR. My outstanding question is “how to disconnect the HT and turn off the “room” when I
This post is a continuation in the series documenting my build of the 5 Watter Organic VCXO Transceiver.
Chuck’s notes mention that he accidently skipped this section and came back to it. Therefore, pictures included parts we haven’t installed yet.
When installing C43, the flat side goes to the square pad.
W8DIZ has a great tutorial on how to wind toroids.
Go to section 10 of the kit (W8DIZ) instructions for lengths and kinds of wire to use for each toroid.
I went back and reread Chapter 1, the overview in the K7QO guide. It was then that I realized that the stages we are building in correspond to the block diagram on page 17.
When winding the binoculor T6, I did a quick tin of the ends on the 2 turn wire so I could keep them identified when I wound them. Failure to strip enamel off of wire is a very common failure. I use sand paper to do a rough removal before stripping/tinning the wire. After soldering into place, check for continuity with a meter.
During the testing, I set my function generator up for 8.064Mhz and a sine wave output. See my workbench for specifics.
I used a browser based audio spectrum generator / analyzer to set up the BFO tone. I think this won’t be called for until later.
I connected the audio output of the 5 Watter to my computer running the spectrum analyzer.
First, I configured the analyzer with the built in tone generator and set it for 600Hz. Then, I adjusted the display so that I would have a reference point for where the 600Hz peak was being displayed. Next, turned on the output of the function generator (to a dummy load with a bit of wire coming off of it). I then adjusted C43 so that the pitch heard and displayed matched up to what I was see with the earlier 600Hz setting. I am sure this is all pre-emptive as the real calibration will happen later in this project.
I checked my crystals with a K7QO crystal checker before installing them.
Pay attention to the instructions about grounding the cases of the crystals X3, X4, X5
The second winding on T5 is a bit counterintuitive. You will wind it the same way you wound the first winding. Check the pictures in the guide and the instructions section 8.2.
Testing, touch C30 with test wire, will get louder audio
To clean enamel:
Alternate approach to counting turns is to wind a bunch of turns and then check actual inductance against expected value. There is toroid information and a calculator at kitsandparts.com you can use to determine the target inductance.
I ordered this case from Amazon
Reasons why I chose this case:
I want a frequency read out for my 5 Watter organic transceiver. So, I ordered Digital Dial/Frequency Counter from QRP Guys.
Reasons I chose this unit:
Besides finding the videos of the 17m build, I found the videos of the 20m build. I added them to my K7QO 5 Watter playlist on YouTube.
I recently had my Elecraft K2 open doing some work on it. I thought I would take the opportunity to align the KAF2. I don’t have a spectrum analyzer. However, I was able to use a browser based audio spectrum analyzer. I connected the output of the K2 to the microphone in line of the station computer.
I used this browser based Sound Spectrum Analyzer to do the alignment. You will need to allow it to use your microphone.
I later found this more fancy Signal Generator and Spectrum Analyzer
Start with the KAF2 set to OFF. Preamp OFF and Attenuator OFF. Antenna, disconnected. RF Gain fully clockwise and AF Gain adjusted to register on spectrum display. Select widest filter option. S1 should be set to IN position.
In order to do the alignment properly, you need to be zero beat on a signal. I tuned the K2 to the birdy at 7Mhz. Then I activated the spot feature. I could clearly see 2 peaks on the spectrum analyzer. I carefully adjusted the VFO so that there was only 1 peak.
Notice all of the noise to the left of the peak.Consult the Elecraft KAF2 manual. Make sure you have your filter configured for the two stage option. Check jumper W1. It should be open. Also, note that there are two pots on the filter to adjust. Turn the first stage of the KAF2 filter on (AF1). Adjust the R1 pot to peak the output.
Note the dramatic drop in noise above the peak. Enable the second stage of the filter (AF2). After adjusting the second stage (with R2) the peak is even more pronounced than before.There is some interaction between the stages. Alternate between adjusting the first and second stage until you are satisfied that it is calibrated for peak performance. The Elecraft manual suggests doing the BFO and filter cap setup CAL FIL
at this time.
This post is a continuation in the series documenting my build of the 5 Watter Organic VCXO Transceiver.
In Phase 3 we are installing the keyer and keying interface sections.
I would also suggest that you solder R33 in place before J5. R33 sits between J5 and the socket for U5.
It is up to the builder to decide if they will hardwire directly to J4 and J5, or install Dupont headers. I opted to install Dupont headers. J4 is used for the command button. You’ll need this during the test phase. I wired the 2 pins next to the J4 designator to a momentary button. J5 is a 3 pin header. Ground is in the middle pin. Connect J5 to a “stereo” or TRS 3.5mm jack.
Refer to section 15 Connections, of the standard kitsandparts.com 5 watter building instructions for guidance on wiring up the jacks and pots.
During the testing of Phase 3, I discovered, that an “optional” 10K linear pot will be needed for the Morse Code speed control.
Cut the wire bundles that come with the mounting hardware in half. You’ll wire these to your connectors. You’re still going to need more wire for the speed pot and the DC jack. I found that having the proper crimp tool made working with the dupont connectors much easier. I ordered one of these Dupont crimping tool kits. The kit also contained extra wire which I’ve used right away.
The crimper is listed on My Workbench Page along with the other tools on my workbench.
I have started researching cases. This is the top enclosure contender at the moment. But I haven’t come to any decision yet.
The tech group I am a part of is leaning towards adding a QRP Guys Digital Dial to our project.
We are following the K7QO guide that is on the kitsandparts.com kit page along with the kit documentation.
However, I discovered that in July Chuck did an independent video series building a 17m version. I created a K7QO 5 Watter playlist on YouTube.
I was lucky enough to be able to get out the morning of May 15th, 2020 and activate Little Dixie Lake Conservation Area in Missouri.
Pay attention to the color stripes/values of the resistors. The colors of the resistors in the K7QO guide did not match with what was expected. In particular, pay attention to R30 and 31, 4K7 resistors – yellow, purple, red, gold color markings.
Don’t forget to read the captions along with the pictures in the guide. The part type for C51 and C59 is different than pictured and noted.
My system current draw at this phase measured 22mA. During the test phase, I was able to use a small breadboard jumper wire to hear amplified audio.
I used female-male breadboard jumpers to temporarily connect the headphone jack. Then used an amplified speaker for testing.
READ instructions before dumping out all of the parts. Several parts are nearly identical and will be extremely difficult to differentiate if you don’t follow the kit instructions. You can inventory and bin some of the components to make your life easier.
We noticed the substitution of SA602 for NE612. There are no dots on the chips to indicate pin 1. We hope, that the NXP logo is in the position of the dot. The data sheet didn’t really enlighten us on this point. Subsequent testing confirmed that the NXP logo is in the position of the dot.
Install the SMD parts first. The part density is high and it would be extremely difficult to add them later. If you are not familiar with SMD soldering there are several approaches/techniques. Techniques include: hot plate, oven, hot air tool, drag soldering, and solder paste. SMD devices can be difficult to see and work with. Good light, a magnification setup of some kind, and a good soldering station are necessities. When using a soldering iron, choice of tip will depend on technique used and user preference. You will also likely use a different tip for SMD work than your regular soldering. I was finding that with the board parts density, I was inadvertently soldering neighboring vias when soldering the SMDs. I cut small strips of painters tape to protect neighboring vias. Doing other work, I had heard of using aluminum foil to protect nearby components. I used a Kester flux pen on the board before putting on the SMD. You may choose to use paste/gel, etc.
There are some minor differences between the K7QO assembly guide and the website instructions. The board and parts have had some minor updates since the guide was created. Keep the original instructions handy during the build too. They include the color codes for the resistors. The assembly guide includes a tip to use some stand offs or bolts/nuts in the corners of the board to keep it above your work surface. Use a board holder as long as you can to make for a more pleasant build process.
W0ODJ’s completed Phase 1 in board holder
Having a current limited power supply comes in very handy when testing. I picked up one from Amazon. It is nice to be able to ramp up voltage. Also, the current limiting feature may keep you from setting some smoke free. A good digital multi-meter is good to have. I have an old Fluke 8010a I picked up from eBay for around $40. Having some bread board jumpers (female-male) that you can use with the header blocks is handy come test time.
In order to deepen our understanding of amateur radio electronics the tech builder group I am a member of decided to build the 5 Watter QRP rig.
K-6524 at Yellow pin, Green Pins 40m phone, Red pins 75m phone, Blue pin 20m phone, Orange pin 30m CW. One nearby 2m FM simplex contact not visible on map.
Hey all, quick report of QCX build 5W CW transceiver kit
Rick KC0PET, Ted KC0RDM and I, K0EMT set up at Little Dixie Lake CA in Calloway County. Initially we checked in at the main boat ramp area. It had a nice pavilion. But, we felt we might be able to do better. So, we went to the disabled accessible trail area. There we found several picnic tables, grills, shade trees and plenty of open field. That
The QRP to the field 2018 event had a river theme going this year. So, Ted, KC0RDM and I, Bryan, K0EMT headed to the Osage River and set up at Pikes Camp Access. It was a chilly morning. I was wearing multiple layers and a hat. After noon though it warmed up into the low 60s with a chilly wind.
Conditions were very tough this year. I only got three contacts. Two with Morse code, one with SSB. Although, I was tickled that one was with Paul, NA5N. I was able to hear quite a few stations. Just didn