-
New GPS receiver
12/12/2021 at 18:41 • 0 commentsIf you've been following any of my other GPS project you'll know that the Venus838LPx-T is being EOLed. SkyTraq's replacement is the PX1100T, which has a number of improvements. It does, however, necessitate both hardware and firmware changes.
On the hardware side, there are fewer parts required. The module itself injects 3.3 volt active antenna power, so there's no longer a need for an external bias-T. It's also a castellated edge board style module rather than an LGA-69 package (which is a lot easier for me to deal with).
On the software side, the serial baud rate is 115200 rather than 9600, and some of the messages are in the form $GNxxx rather than $GPxxx, which reflects the quad constellation support.
One disadvantage is that there is no FIX LED output pin, so for backwards compatibility I've implemented the equivalent behavior (on for bad GPS, blinking at 1/2 Hz for good) on one of the controller pins. You could argue that it's redundant, given that one of the debug pins is simply on for bad and off for good GPS. The benefit to it before was that it was from the receiver module itself, and thus independent of the controller.
-
No more preamp
09/28/2019 at 17:28 • 0 commentsI finally figured out why the preamp was always necessary and how to remove it.
The problem was quite basic. I had always wanted to put a cap in parallel with the feedback of one amp or the other to act as a low pass anti-alias filter for the digital audio. I calculated the correct value as 2200 pF but wound up buying 0.022µF caps (that is, 22,000 pF). In working on Evil Simon, I figured this out and have been using 1000 pF caps ever since with great success.
Well, it turns out that if you configure the LM4871 for unity (it's actually 2x because of the push-pull design) gain with a 1000 pF cap in the feedback path, you can remove the pre-amp entirely and everything is just fine. The volume range is quite reasonable and at low volume, it sounds clean.
To do this with the existing boards, replace C25, R4 and R8 with 0Ω resistors, remove IC5 and C26 and populate C20 with 1000 pF. This effectively connects pin 3 of the volume control directly to the output of the balance control and moves the LPF feedback cap to the LM4871. If you're populating a new board, you can leave off C21, C22, R13 and R14 as they're not used for anything, but if they're already installed there's no harm in leaving them.
This will wind up being v1.4.
-
v1.3.1 - SPI flash
08/18/2019 at 01:01 • 0 commentsThe v1.3.1 hardware works perfectly. There are some tweaks to the programming process, obviously, and a few tweaks to the code, but programming the flash chip with "flashrom" both from a mac with a BusPirate and from a Raspberry Pi using its SPI interface is fairly straightforward. In fact, the Pi can successfully program the chip with an SPI clock of 20 MHz, which makes it much, much faster. If you're building your own version, you should check that flashrom supports the flash chip you want to use. I didn't do this beforehand and had to add support for it to flashrom for it to work right. The clock itself doesn't really care about what kind of chip it is, as long as a "0x03" read command works and it supports a maximum SPI clock of at least 16 MHz (it also obviously has to have at least enough storage for all of the audio samples).
-
µ-law audio compression
08/05/2019 at 18:17 • 0 commentsThere was never any reason to compress the audio back when it was on µSD cards. But flash rom SOIC chips aren't anywhere near as large. That's ok, though. You can get 16 MB flash chips, and the audio for the talking clock didn't need half that much space. But in the interest of reducing the BOM cost even further, I've investigated whether going from raw 12 bit audio to 8 bit µ-law encoded audio would work. It turns out it works just fine - the audio is half the size but the fidelity to my ear is exactly the same.
µ-law audio uses an exponential system for the quantization step. The closer to zero (µ-law is inherently signed. Our audio system requires unsigned values, so we also convert to unsigned as part of the decoding) a value is, the less difference there is between adjacent values. Values far from zero have a much wider separation.
The conversion used by the firmware is compatible with the mu-law codec in sox, which makes it particularly convenient to prepare audio samples. You just turn whatever your source audio is into raw 8 bit single channel 8kHz µ-law audio streams.
-
µSD -> SPI flash
08/03/2019 at 03:09 • 0 commentsOne thing that bugs me a little is that the micro SD cards are a significant expense. Not only do you have to buy the card, but you have to buy the socket for it too.
In principle, there's no real need for removability here. While it would simplify field updates of the audio samples, it doesn't make doing field updates impossible. In addition, it makes the whole system more reliable, since mechanical jolts can't loosen the chip like a card.
We'll stick with using petitFFS and a FAT filesystem, but the diskio layer is far, far simpler - you send a 3 (the read command), a 3 byte start address, and then you read until you're done (yes, in principle you can read the whole chip with one command).
To program the chip, you have to either erase the controller's flash (to keep it from trying to talk to the flash) or hold it in RESET. Since the controller's programmed with PDI, it's necessary to use a separate programming interface for this. I simply chose the traditional AVR ISP pinout, substituting !CS for the !RESET pin. When used for AVR programming, the normal sense of the MOSI and MISO pins are actually reversed - the AVR chip acts like an SPI slave, listening on MOSI and talking on MISO.
My intention is to write a little program for the Raspberry Pi's SPI interface to just burn an image file into the chip using just 6 wires hooked up to my 6 pin pogo adapter.Turns out there's a program called "flashrom" which will already do this, and it too supports the Raspberry Pi SPI interface. But it also supports various USB peripherals, so I'm going to try using a Bus Pirate v4 on my mac for this. If that doesn't work, the fall-back is the Pi. -
More volume control tweaks
01/25/2019 at 05:19 • 0 commentsThe latest design moves the volume control to after the preamp, which cuts down on the low-volume noise. I also changed the balance control to a through-hole trimmer so it'll be easier to adjust. I also found a .1" SIP trimmer that can be used for a board-mount volume control, or replaced with wires to a panel mounted volume control.
-
Volume control tweaks
12/17/2018 at 00:10 • 0 commentsI did some experiments on the volume control system. Two volume controls for separate control over the speech and beeps is a bit unsatisfying, so I've changed it to instead be a balance control followed by an overall system volume.
While I was at it, I discovered that cutting the preamp gain in half made for better volume control range and less noise. I'm pretty happy with the result.
The only question left really is whether to make the volume control external or not. It's definitely more convenient to have a knob, but that adds to the cost compared to a board mounted trimmer.
-
More firmware options
09/06/2018 at 21:31 • 0 commentsOne customer recently asked for a mode of operation more like WWV than the USNO. That is, 59 ticks and one beep per minute, with a single time announcement in the last ten seconds.
To accommodate that, there is now a WWV macro in the firmware, so this mode is a compile-time choice.I’ve also been asked to make a 12 hour AM/PM clock.
You can actually do that by just re-recording the hour audio samples. You can do that by just copying the 12 sample over the 0 and copying 1 through 11 over 13 through 23. That would give you a purely 12 hour clock. If you want AM/PM as well, then you have to either re-record all the hour files to add AM or PM... which would result in a script like “At the tone, Pacific Daylight Time will be 4 PM, 23 minutes, 10 seconds.” If you’d prefer “4 hours, 23 minutes, 10 seconds PM,” then firmware work would need to be done to support it.
Frankly, I like the easy way, and not just because I’m lazy. It just seems a more natural way of reading it.
-
Laser cut wood case
02/20/2018 at 06:59 • 1 commentMy friends at Steamy Tech helped me finalize the design for the laser cut and engraved wood case that's coming soon to the store. It's 4" x 4" x 2", and by housing the speaker in a cavity that size, the bass is really accentuated and the whole thing just sounds a whole lot better.
The DIP Switches are accessible through a cutout on the back panel (you mount the DIP switches on the opposite side as the components for using the case), and the big red button on the top has the obvious function.
They've got a few pressing items on their schedule, so it'll be a week or so before the inventory of cases is available, but I think it'll be worth the wait.
EDIT: The case doesn’t have any viewports for the LEDs, but it turns out you can see the FIX LED through the speaker cone. If it’s not blinking, then GPS isn’t working. That’s the number two reason (after the speaker being turned off) that the clock would be silent.
-
Chimes and configuration
02/06/2018 at 17:27 • 0 commentsI've added support to for optional chimes and hour-strokes at the top of the hour.
That sort of begs the question as to how to enable/disable the chimes temporarily when you don't want them.
The DIP switches would seem the natural mechanism, but there are only four of them, and I don't want to just keep piling them on.
It occurred to me this morning that I could simply add a config file to the top level of the SD card. That would allow configuration of, say, 8 different timezone/DST settings with the DIP switches and set one switch aside to turn the chimes on and off.
EDIT: The chimes now can actually be on any minute you like, with optional per-hour STROKES at the top of the hour. The SD card now comes programmed to perform full-on Westminster Quarters.