Well, ive hit an impasse with the scan code!
My ancient brain knows that what I need to do involves a couple of decision making loops and a flag variable to keep track, but ive had to revert to asking yet again for help from experienced coders.
This is for the code which, on the face of it, has a simple job - if there is a signal, wait, if not, keep scanning. The difficulty comes from the 2nd part of the process - if there was a signal, but now there isnt, wait for a bit and see if it comes back...
In other words, getting the code for the scanners dwell time, that is, how long it remains on a previously active frequency waiting for it to become active again, is far from as simple as it sounds!
This is the penultimate code puzzle as well! After this, all that remains at this stage, to implement the 'blind scan' function (that is the simple system without external control) is to add the external interrupt input that will allow an active channel to be jumped off and the scan resumed. Im hoping that will turn out to be simpler to do!
Then, its all hardware again! First the potential divider bank and switching, then the MOSFET power on controls. After that its time to install it all into the radio and see how it works. If alls well, then the miniturisation process starts!
Musings and adventures in amateur radio, electronics home construction, military comms equipment, charity long distance walking, life and career
Friday, 22 February 2019
Thursday, 21 February 2019
PRC344 Scan Controller progress
Much of the technical design work for this has been completed, but the odd interesting challenge still shows itself! As part of the testing necessary to get a working system, yesterday I was looking at the LOCK and MUTE control lines within the radio.
The LOCK line, which originates from the synthesiser and indicates that the frequency is locked and steady, showed itself to be perfect for the job - a 3V logic 1 when locked. I have the PIC code now written such that unless a particular input pin, connected to the LOCK line, is high, the scan is inhibited. This means that the rate of scan is ultimately directly limited by the speed the synthesiser attains lock.
The MUTE line, on the other hand, proves to be a bit 'odd'.
When the receiver is muted fully, this is a +ve 5V line, but, when the radio is unmuted, i.e. there is a signal being received, then this line goes to -ve 4.4V! Worse than that though, is the condition in the presence of a poor mute or wideband noise, where the line seems to be able to jump around various positive values between 0-5V.
My thoughts at the moment are to use a simple resistive potential divider and a blocking schottky diode. This should give me a cleanish +ve or zero value for the PIC input pin.
All these extra parts will need to go on the controller PCB, since, as you can see in the photo below, there isnt any space near the connections to add any parts!
So the PIC code now is capable of sequencing the whole of the synthesisers 3600 frequency steps, plus the 18 HT tuning lines, and also of being inhibited by the LOCK line. Ive also checked that the outputs when set low will sink current not float, ensuring that the blocking diodes on the synthesiser control lines will result in clean control signals.
There are just two controls to be implemented now in code - the MUTE control, and all its associated complex dwell times, and the Over-ride control, which will break the code out of the MUTE controls in the presence of a received signal, and continue the scan, if the radios CALL switch is activated.
Amongst all this, ive also found a moment to put another batch of my tropical wine on...
The LOCK line, which originates from the synthesiser and indicates that the frequency is locked and steady, showed itself to be perfect for the job - a 3V logic 1 when locked. I have the PIC code now written such that unless a particular input pin, connected to the LOCK line, is high, the scan is inhibited. This means that the rate of scan is ultimately directly limited by the speed the synthesiser attains lock.
The MUTE line, on the other hand, proves to be a bit 'odd'.
When the receiver is muted fully, this is a +ve 5V line, but, when the radio is unmuted, i.e. there is a signal being received, then this line goes to -ve 4.4V! Worse than that though, is the condition in the presence of a poor mute or wideband noise, where the line seems to be able to jump around various positive values between 0-5V.
My thoughts at the moment are to use a simple resistive potential divider and a blocking schottky diode. This should give me a cleanish +ve or zero value for the PIC input pin.
All these extra parts will need to go on the controller PCB, since, as you can see in the photo below, there isnt any space near the connections to add any parts!
That pin there... |
So the PIC code now is capable of sequencing the whole of the synthesisers 3600 frequency steps, plus the 18 HT tuning lines, and also of being inhibited by the LOCK line. Ive also checked that the outputs when set low will sink current not float, ensuring that the blocking diodes on the synthesiser control lines will result in clean control signals.
Control mock-up |
Amongst all this, ive also found a moment to put another batch of my tropical wine on...
Tropic Thunder Brew |
Thursday, 14 February 2019
Project Round Up
Several projects are now either coming to completion or entering a more technical phase. The QRP Labs VFO kit just requires a little reshaping of its case and the addition of a suitable regulator for its 5v supply. I only have a single 7805 device spare, and these waste a heck of a lot of power as heat, so am looking instead to use a Buck converter here. I happen to have the PCB from a broken (physically) USB car charger, which I think will do nicely.
With the VFO complete, I can then start to experiment with the PRC-349s!
The QRP Labs 5W PA kit is now complete save for testing and alignment. I think I can get away with setting up the bias on the bench, but the rest might need to wait for its installation into the U3S case.
Modifications to the U3S include the addition of an RF changeover relay and another RF connector for the switched through antenna to feed a receiver, plus perhaps a couple of auxiliary relays, and new firmware. But before that, the QLG1 GPS has to be mounted into its specially 3D printed box and bolted to the top of the U3S case! Many thanks to my colleague Alex for that.
The PRC-344 Scan Control project has completed design phase, and now requires software! This means ive to learn to code in C for a PIC16F887! Im no coder so this is probably going to be the most difficult part of the project! I'll get the basic 'Blind Scan' system working first, before considering the remote control and battery monitor functions - all of which require some very clever features! Ultimately though learning the coding will lead to the remote VFO controller for the PRC-320!
Ive also got to repair my ladders, for which a number of 100mm M5 bolts are on order. But before ANY of this work can be completed, I have to finish replacing the mains distribution in the workshop, oh and put a couple of wines on...
With the VFO complete, I can then start to experiment with the PRC-349s!
The QRP Labs 5W PA kit is now complete save for testing and alignment. I think I can get away with setting up the bias on the bench, but the rest might need to wait for its installation into the U3S case.
5w PA prior to adding the power devices |
The PRC-344 Scan Control project has completed design phase, and now requires software! This means ive to learn to code in C for a PIC16F887! Im no coder so this is probably going to be the most difficult part of the project! I'll get the basic 'Blind Scan' system working first, before considering the remote control and battery monitor functions - all of which require some very clever features! Ultimately though learning the coding will lead to the remote VFO controller for the PRC-320!
Ive also got to repair my ladders, for which a number of 100mm M5 bolts are on order. But before ANY of this work can be completed, I have to finish replacing the mains distribution in the workshop, oh and put a couple of wines on...
Thursday, 7 February 2019
Louder Whispers
I have to say, again, I really do like the kits Hans Summers designs and produces, and so have now begun the 5W HF PA, to add to my U3S beacon. Despite the very compact PCBs, construction of QRPlabs kits is amazingly straightforward, as Hans really does guide you through step by step with superbly detailed assembly instructions.
Along with the 5W PA kit, I also ordered a new MCU for my U3S with the latest firmware, as this supports the external switching functions I intend to use to add an antenna changeover relay to give an ongoing antenna feed out to a receiver - in my case an FRG-100.
But enough! You dont want to hear me chatting about this, so, here are the pictures of the build so far...
This stage was the only time I had any mishap with tonights part of the build, when I inadvertently let solder flow into an adjacent hole. Rather than go to the trouble of clearing the whole, I simply positioned the leg of the resistor that was to go into it, and melted the solder while gently pushing the resistor in, so it slid cleanly down and through.
Thats it for tonight! Im going to spread this build out over a few days. Hopefully, by the time I complete this, including installing and connecting it up inside the U3S case, I will also be in a position to make a final good job of the QLG GPS receiver that governs the beacon. A work colleague is into 3D printing, and has offered to print me a case to my specifications for the QLG, which will bolt onto the top of the U3S case, finally making a neat and tidy all in one job of it.
Before I get too far into the semiconductors, I really should finish the rewire of the mains distribution for the bench! The 4-way socket is being replaced with a 6-way. And the earth pins on the ESD plugs, which is what has damaged the safety shutters on the 4-way panel, are going to have a bevel filed into them! At least the workshop lighting has now been replaced with the new LED strips. If only now I could get used to the new location of the light switches!
Along with the 5W PA kit, I also ordered a new MCU for my U3S with the latest firmware, as this supports the external switching functions I intend to use to add an antenna changeover relay to give an ongoing antenna feed out to a receiver - in my case an FRG-100.
But enough! You dont want to hear me chatting about this, so, here are the pictures of the build so far...
The bagged kit. Good strong bags! |
Capacitors fitted. The quality of the PCB can be seen here |
Fitting the resistors. This kit is rather resistor heavy! |
All the 1/8w resistors fitted except one (a later mod) |
The 2W 0.33r resistor and the preset installed |
5V regulator and IC socket now fitted |
Before I get too far into the semiconductors, I really should finish the rewire of the mains distribution for the bench! The 4-way socket is being replaced with a 6-way. And the earth pins on the ESD plugs, which is what has damaged the safety shutters on the 4-way panel, are going to have a bevel filed into them! At least the workshop lighting has now been replaced with the new LED strips. If only now I could get used to the new location of the light switches!
Monday, 4 February 2019
SMT and PCB design
The projects im currently working on, if im to make them fit into the equipment they are designed for (ie, not just remain 'bench experiments') require converting to compact PCBs using SMT parts.
Designing PCBs properly requires following a few special rules. Sadly, the auto-routers provided with most PCB CAD packages fail to follow these rules properly. One of these rules is that the use of blind vias (that is through board connections without a through hole component legs) should be kept to an absolute minimum.
This leads to a big problem with the sort of ultra compact, digital electronics im working with. Up until now, the top copper of a PCB has, in most of my work, been strictly RF groundplane. Now, I find im having to work with both top and bottom copper as signal lines, as well as power and ground connections. Add into this the additional rule that top copper tracks cannot pass across IC pin pads except where the package is large enough, such as a SOIC, then any auto-router naturally creates multiple blind vias.
So I find myself manually routing PCB layouts, not on the CAD packages, but on paper, with the help of several coloured pens. By playing with the orientation of the IC packages, eventually it is possible to come up with an effective layout that obeys the rules.
Designing PCBs properly requires following a few special rules. Sadly, the auto-routers provided with most PCB CAD packages fail to follow these rules properly. One of these rules is that the use of blind vias (that is through board connections without a through hole component legs) should be kept to an absolute minimum.
This leads to a big problem with the sort of ultra compact, digital electronics im working with. Up until now, the top copper of a PCB has, in most of my work, been strictly RF groundplane. Now, I find im having to work with both top and bottom copper as signal lines, as well as power and ground connections. Add into this the additional rule that top copper tracks cannot pass across IC pin pads except where the package is large enough, such as a SOIC, then any auto-router naturally creates multiple blind vias.
So I find myself manually routing PCB layouts, not on the CAD packages, but on paper, with the help of several coloured pens. By playing with the orientation of the IC packages, eventually it is possible to come up with an effective layout that obeys the rules.
Friday, 1 February 2019
PRC344 Scan Project, further design work
Ive spent many hours this last week working on the design details for this project, and each time it has come down to a toss up between physical size and number of IO ports.
While working out the details, the need to draw virtually no current from the radio was paramount. Originally, the plan was for zero current, as all the control electronics would be isolated, but a flaw in the radios original design has led to a change of perspective - the PRC344 has no battery low warning!
Now, PIC chips can be put into sleep modes where they will draw negligible current, in the order of a few micro-amps, yet still react of external or some internal interrupts. So I started thinking of ways to monitor the battery with the MCU, and to set up a low battery warning. But this meant that the MCU would have to be powered all the time, so the search extended to 3v regulators that not only could cope with a 24v input, but also had extremely low quiescent currents. This in turn led to finding serial line drivers that also had ultra low current sleep modes!
But all that was irrelevant compared with another small problem. The MCUs I had chosen did not have enough IO ports to run the system, and so required port expanders. These extra chips need controlling over a serial data link such as SPI or I2C. As im trying to design this to use materials I already have, I found my lack of coding knowledge a major disadvantage, as none of my devices has SPI, only I2C, and none of my stock of preferred MCUs can do I2C natively. This meant I would have to bit-bang the entire instruction set for the port expanders from scratch!
One device I do have though, which can not only do SPI or I2C through native hardware, but also has sufficient IO ports to mean I dont even need the port expanders, is the PIC16F887. But I had originally discounted this device due to its size - a 40pin DIP!
But the realisation came to me that since I was trying to make this a very small unit, and so was looking at SMT parts for almost everything, I should look at the SMT packages for this chip - and the 44pin TQFP package is only 10mm square yet the legs are relatively accessible!
So, a redesign using the 16F887 has resulted in a system that has just 6 ICs (including a sophisticated LDO regulator and RS232 line driver), will fit in the space left by disabling the radios transmitter, and can monitor the battery voltage during sleep mode to bring the entire systems quiescent current draw down to just a few tens of micro-amps!
...oh, and the code now is little more than beginner level port on/off stuff!
I'll start prototyping on the weekend, first testing out basic port driving code and E2PROM stored look-up tables. Sadly I cant prototype with the HV multiplex chips yet as I cant find my SMT break-out PCBs, and have had to order more.
While working out the details, the need to draw virtually no current from the radio was paramount. Originally, the plan was for zero current, as all the control electronics would be isolated, but a flaw in the radios original design has led to a change of perspective - the PRC344 has no battery low warning!
Now, PIC chips can be put into sleep modes where they will draw negligible current, in the order of a few micro-amps, yet still react of external or some internal interrupts. So I started thinking of ways to monitor the battery with the MCU, and to set up a low battery warning. But this meant that the MCU would have to be powered all the time, so the search extended to 3v regulators that not only could cope with a 24v input, but also had extremely low quiescent currents. This in turn led to finding serial line drivers that also had ultra low current sleep modes!
But all that was irrelevant compared with another small problem. The MCUs I had chosen did not have enough IO ports to run the system, and so required port expanders. These extra chips need controlling over a serial data link such as SPI or I2C. As im trying to design this to use materials I already have, I found my lack of coding knowledge a major disadvantage, as none of my devices has SPI, only I2C, and none of my stock of preferred MCUs can do I2C natively. This meant I would have to bit-bang the entire instruction set for the port expanders from scratch!
One device I do have though, which can not only do SPI or I2C through native hardware, but also has sufficient IO ports to mean I dont even need the port expanders, is the PIC16F887. But I had originally discounted this device due to its size - a 40pin DIP!
But the realisation came to me that since I was trying to make this a very small unit, and so was looking at SMT parts for almost everything, I should look at the SMT packages for this chip - and the 44pin TQFP package is only 10mm square yet the legs are relatively accessible!
So, a redesign using the 16F887 has resulted in a system that has just 6 ICs (including a sophisticated LDO regulator and RS232 line driver), will fit in the space left by disabling the radios transmitter, and can monitor the battery voltage during sleep mode to bring the entire systems quiescent current draw down to just a few tens of micro-amps!
...oh, and the code now is little more than beginner level port on/off stuff!
I'll start prototyping on the weekend, first testing out basic port driving code and E2PROM stored look-up tables. Sadly I cant prototype with the HV multiplex chips yet as I cant find my SMT break-out PCBs, and have had to order more.
Subscribe to:
Posts (Atom)