For the past few weeks I’ve been working on putting together an RxTx Ensemble transceiver. Using the available instructions I finally finished it, only to realize I didn’t have a suitable case.
I’ve seen advertisements for a nice aluminum case for this radio but it no longer appears to be available. I also found files for a 3D printed case on Thingiverse but didn’t want to sit for the Slicer predicted seven hour print time. I was ready to build a case from copper clad board as described by WA4MNT but then remembered a trick I ran across in another case build. The designer used copper clad board for the case walls but 3D printed corner posts to hold them in place. This seemed a nice compromise so I decided to give it a try.
Materials used to create the case include:
- Two 2.5″ x 2″ (64mm x 51mm) side panels from .032″ copper clad board
- Two 5″ x 2″ (127mm x 51mm) front and back panels from .032″ copper clad board
- Two 5.5″x3″ (140mm x 77mm) top and bottom panels from .032″ copper clad board
- 1 cm spacers to mount the transceiver on the bottom panel
- Four 3D printed corner posts
- Screws to mount the 3D printed corner posts to the top and bottom panels
Putting It Together
The first step is to print the corner posts and make sure the screws will fit. The figure below shows the corner post design. It is designed to stand vertically, with the side and front/back panels fitting into the slots shown. The OpenSCAD and STL files are available in my GitHub repository.
I printed the corner posts using PLA with a .3mm resolution and the vertical shell set to 1 perimeter. If you set the vertical shell to more than 1 perimeter the material may overflow and fill the slots intended to hold the case walls.
The screw holes were sized for 2.6mm self-tapping screws I had on hand. The alternative is to drill the holes out and tap them for use with M3 screws.
Once the corner posts are ready, drill a 1/8″ (3.2mm) hole at each of the corner of the top/bottom panels, 1/8″ (3.2mm)from each side. Attach the top and bottom panels to the corner posts as shown below.
Now remove the top panel and insert the side and top/bottom panels into corner posts. Then replace the top panel to confirm everything fits together properly. If it’s necessary to trim the side or top/bottom panels, only remove a small bit of material at a time.
At this point you should have a small copper clad box as shown in the figure below.
Mounting The Transceiver Board
Disassemble the box and select which panel will serve as the bottom of the case. Drill two 1/8″ (3.2mm) holes at the front corners, 3/8″ (9.5mm) from each side. These will be used to mount the spacers that hold the board in place. I used four spacers to support the circuit board but drilled only two holes since that’s all that’s needed to hold the board.
Creating The Front Panel
A template for the front panel is shown below and can be downloaded from the same repository containing the corner posts. It was layed out assuming that 1cm spacers will be used to mount the transceiver circuit board. If you use a different size spacer you’ll have to adjust the holes’ vertical locations as appropriate.
Print the template at 100% scale and tape it to the side of one of the front/back panels that will face outwards. Compare the hole locations to the circuit board jacks to make sure they line up properly, then drill out the holes as shown and reassemble the case.
Some Followup Items
My assembled case is shown below. I’m still considering a couple of improvements.
Right now the transceiver jacks aren’t labeled. Since the case is made of copper clad, this can be done using the toner transfer method directly on the front panel. Also, the case is tall enough to mount a small fan on the back to provide forced air cooling. I think I’ll have to wait and see how the transceiver performs before doing that.
I’ve put together a number of project using the Si5351. However, I’ve got to admit that with its surface mount package and need for an external crystal, it’s kind of a hassle to work with. For that reason, I purchased a few Si514 to see how they compare.
The Si514 is a single frequency user-programmable I2C oscillator, similar to the Si570. It covers the frequency range from 100 kHz to 170 MHz (or in some cases, 250 MHz). Some things I particularly like about it are the integrated crystal and the availability of a package whose surface mount pad spacing is compatible with stripboard. It doesn’t have as wide a frequency range as the Si570 or Si5351 but my projects typically involve frequencies below 30 MHz so that’s ok. And being able to easily order them through DigiKey is another plus.
To try it out I mounted the chip on a small piece of stripboard to serve as a carrier and connected it to an AdaFruit Trinket programmed to act as a USB-to-I2C interface. I modified the Si5351 Python code I had previously written to work with the Si514 and, after fixing a few bugs, had a working clock.
But Where’s the Software?
Like the code I previously wrote for the Si5351, the Python code for the Si514 is available in my GitHub repo. It was written to work with the previously mentioned I2C Stick software but should be easy to modify for use with another I2C interface.
To use the software, pull the files from the repo, place them in a a convenient location, and execute the command:
$ ./py514 -f [frequency_in_Hz]
If you don’t specify the frequency it will use a default of 10 MHz.
When I started working on this I was a little surprised I didn’t see more projects out there using the Si514. Considering its small size and availability, I think it’s time to start updating some of my other projects to use it.
In the previous post I described the algorithm for converting a binary number to binary-coded-decimal (BCD). In this post I’ll describe an algorithm for doing the reverse; converting a BCD number to binary.
The algorithm is based on repeated division and is best explained by example. Begin with a decimal number and divide by 2. The remainder becomes the high order bit in the binary number, the quotient carries forward. Repeat the process for the required number of bits. The table below shows an example for the decimal number 204.
For a BCD number start at the most significant digit (MSD). Shift right to divide by two, moving the least-significant bit (LSB) into the carry. Since the remainder after dividing by 2 is the LSB, add 10 to the next significant digit if the carry is set and repeat. Limiting ourselves to number in the range from 0 – 255 (8 bits), in PIC assembly language with 8-bit registers this would look like:
; Load the registers movlw d'2 ; load BCD digit 2 movwf DEC2_REGISTER ; movlw d'0 ; load BCD digit 1 movwf DEC1_REGISTER ; movsw d'4 ; load BCD digit 0 movwf DEC0_REGISTER ; clrf BIN_REGISTER ; clear the binary register movlw d'8 ; load the counter movwf COUNTER ; ; Perform the division DIVIDE DIGIT2 bcf status, c ; clear the carry rrf DEC2_REGISTER,1 ; rotate digit to the right, putting LSB into carry btfss status, c ; skip if there is a remainder goto DIGIT1 ; jump to the next digit movf DEC1_REGISTER,0 ; get the next digit addlw d'10 ; add 10 movwf DEC1_REGISTER ; move it back DIGIT1 bcf status, c ; clear the carry rrf DEC1_REGISTER,1 ; rotate digit to the right, putting LSB into carry btfss status, c ; skip if there is a remainder goto DIGIT0 ; jump to the next digit movwf DEC0_REGISTER,0 ; get the next digit addlw d'10 ; add 10 movwf DEC0_REGISTER ; move it back DIGIT0 bcf status, c ; clear the carry rrf DEC0_REGISTER,1 ; rotate the digit to the right, putting LSB into carry ; Update the counter. BINARY rrf BIN_REGISTER,1 ; rotate remainder into the binary register decfsz COUNTER, 1 ; decrement the counter goto DIVIDE ; back to the top of the loop ...
Note that as written, this will not work with 4-bit BCD numbers because adding 10 to a digit could potentially move it outside the range of 0 – 15. However, like the Binary to BCD algorithm, there is an optimization to be performed that will allow it work with 4-digit BCD.
Instead of checking the carry flag and adding 10 before shifting the next digit, perform all the shifts up front. As mentioned previously, the remainder of division by 2 is simply the register’s least-significant bit (LSB), which, after the shift, becomes the MSB of the next digit’s register. After performing the shifts, check each register’s MSB. If it’s set there was a carry. Clear the MSB and add 5 (because we’ve already done the division via the shift, it’s 5 instead of 10). The code becomes:
; Load the registers movlw d'2 ; load decimal digit 2 movwf DEC2_REGISTER ; movlw d'0 ; load decimal digit 1 movwf DEC1_REGISTER ; movsw d'4 ; load decimal digit 0 movwf DEC2_REGISTER ; clrf BIN_REGISTER ; clear the binary register movlw d'8 ; load the counter movwf COUNTER ; ; Perform the division ; Shift the registers DIVIDE bcf status,c ; clear the carry rrf DEC2_REGISTER,1 ; rotate digit to the right rrf DEC1_REGISTER,1 ; rotate digit to the right rrf DEC0_REGISTER,1 ; rotate digit to the right rrf BIN_REGISTER,1 ; rotate binary number to the right ; Clear the MSB and add 5 if MSB is set. ; You don't have to check digit 2 because it will always have ; been zero shifted into its MSB. DIGIT1 movwf DEC1_REGISTER,0 ; move digit to the acc btfss DEC1_REGISTER,7 ; skip if MSB is set goto DIGIT0 ; jump to the next digit andlw h'7f ; clear the MSB addlw d'5 ; add 5 movwf DEC1_REGISTER ; move the digit back DIGIT0 movwf DEC0_REGISTER,0 ; move digit to the acc btfss DEC0_REGISTER,7 ; skip if MSB is set goto BINARY andlw h'7f ; clear the MSB addlw d'5 ; add 5 movwf DEC0_REGISTER ; move the digit back ; Update the counter. BINARY decfsz COUNTER, 1 ; decrement the counter goto DIVIDE ; back to the top of the loop ...
As written this code is for 8 bit registers. However, the algorithm is compatible with 4-bit BCD since the value in any of the 4-bit registers will always be in the range from 0 – 15.
If you think about it, this algorithm nicely complements the binary-to-BCD algorithm. For binary-to-BCD you subtract 5 before setting a register’s MSB. For this case, you clear the MSB and add 5. Makes it easy to remember too.