So I am trying to find a new micro to use. Arduino had too many limitations, ESP32 has I2C issues with certain libraries and I just want milk that tastes like real milk. I do not think that it is all that much to ask that your crap just works and does what its meant to. And so here I am trying to find something new that is not all that expensive and kind of just works. I may have found it with the STM32 Blackpill and ST-Link.
Setup in platformIO is just a matter of selecting the right board type and letting the software download the required files and editing the dot ini file to setup certain parameters.
Pretty much all i did here was change the upload protocol to stlink because i have never been able to get dfu to work ever for whatever reason. The other thing I like about using an external programmer is that I get full debugging of the code and i do not have to pull the board in and out of my circuit all the time to program it, or in the case of the arduino’s pulling the IC off the board all the time.
Actually the main thing I am after is the ability to have interupts on any pins I like, not just on the 2 that arduino gives. If the bloody libraries for ESP32 would work right with the SI5351a i would not have had to go down this path. But alas I cant fix it and I am not sure those who are smarter than me can either. Plenty of hacks out there as workarounds, but that just ends up breaking other things I have on the I2C bus. So for now, it looks like I might be going blackpill. And you know what they say, once you go black, you never go back.
Welcome to my tail of woe.
What seems like a long time ago now, back in April, I stopped using ATmega micro controllers and settled on using ESP32 for everything. SEE: https://robs-blog.net/2020/04/08/esp32-with-dual-vfos/ . Back then, i made note that some had been reporting issues with Jason Mildrum’s Etherkit library and ESP32. I did not have this problem, thankfully. Until, today that is and now everything is broken.
I think the reason why I never had any issues like the guys have reported here: https://github.com/etherkit/Si5351Arduino/issues/66 was because my ESP32 install was a rather old one, I think it was even from before espressif took over things. And then I switched over to using PlatformIO SEE https://robs-blog.net/2020/11/27/programming-with-platformio/ and a bunch of things got updated and my old very working implementation got screwed up.
I have tried to narrow down what the issue is, but its beyond my skills as a pretend programmer. So I started to try and rule things out. Its not an actual hardware issue, because other I2C things all work fine. and I can get the SI5351 to work using other libraries, like the one from Adafruit and the one I am now using above from Pavel Milanes SEE: https://github.com/pavelmc/Si5351mcu . So after losing days screwing about with this and chasing my tail, I now get to go and rewrite a whole bunch of code that no longer works. So the crap on my bench actually works again.
So tonight, i want to get the code working on the WSPR brick again so that tomorrow I can fix the PA i destroyed and then get it on the air over the Xmas/New Years break and ro also get the receiver thats part build on the protoboard working also. Cant make a receiver without a bloody signal source LOL. No family for Xmas this year because of covid. So tomorrow I will work on stuff in my office.
Go me, I got this one working in pretty quick time. I am actually rather happy now. One more to do for the VFO on the protoboard and
So sometime ago I stopped using the Arduino environment for programming micro controllers and started using PlatformIO. It offers a lot of advantages over the former and anyone who has programmed before using other environments will like the fact that you can use a really well featured IDE.
Programming for me was something I learned over 20 years ago, as a game developer for MUDS, which were text based roll playing games, written in C on linux. Mostly I was using the Kdevelopment IDE, but at other times I have used Netbeans and Eclipse when dabbling with languages like Ruby and LUA.
The great thing about PlatformIO is that its platform independent and supports over 800 different boards and you are not locked into using a particular IDE, you can use pretty much whatever IDE you like. I am using Visual Studio, but it supports about a dozen other IDE so you can choose what you like to work with.
The major benefits of using platformIO is that you have a propper debugger built in and that you have greater control over where your libraries are installed. If you look in the navigation pane to the left of the IDE, you will see that the non core libraries that I used are all installed in a directory called LIB within the project. This means when you do backups of your projects, you keep everything together where it needs to be.
For me, this means I have code, schematic, board layout, test documents and datasheets for the one project all together in one place and if i chance something, i have it tracked. There are a few things that work differently than with the Arduino IDE, like there are no drop down menus for selecting things, but once you get your head around using and editing the ini file, you will find that you have a lot more control over the things you are trying to do. And often, that level of control is very useful to have.
If you are looking to graduate from Arduino, give platformIO a go, I think you will be pleasantly surprised and enjoy your coding for ham radio projects just that little bit more.
So i am on the 4th iteration of this board and I have just about got it right. Kind of sad that its taken me so many goes to get this right, but what can i say. LOL. There is still one bodge wire on the backside of the board because I somehow left off a trace joining one row of push buttons off the 5v line. I am also not sure about the 5V regulator, its running very hot and it should not because its should only have about 300ma running thought it and there is no short to ground anywhere i can find, to explain it running so hot. By hot im guessing its hitting over 60 Deg C as its painful to touch.
Anyway, back to the point of this post. I have gotten back into coding things up and am making inroads. It mostly works now. Pressing the mode button will cycle through LSB, USB and CW. The band button will cycle through 80, 40, 20 and 15m the 4 bands that this radio will support, selecting the appropriate filter banks for both Low Pass and Band Pass filter boards as well as change the IF filter to a narrow CW filter in that mode.
The logger button will put it into logging mode, which along with a keyboard will make log entries and save them to SD Card in ADIF format. The logger is loosely based on my old arduino logger code which can be found in the menu bar above. Though, the code that is going into this is much more refined and polished and fixes most of the clunkyness that was in the earlier versions. I am a much improved programmer now than i was a few years ago when i wrote that code.
The VFO button will exit the logger and put the radio back into VFO mode. I still need to add in a couple more push buttons, one to change the Attenuation setting and the final one to allow changing the TX RX offset. At the moment it is hard coded for a 600hz offset for CW operation, but, i am going to make that variable for real split operation in SSB as well.
Anyway, that is where I am at with this at the moment. When i get things closer to being done, I will probably make a video of all the functions in action to put on youtube. But that is likely to be a couple of weeks away yet. Lots of work to be done in the mean time.