DS1250Y/DS1650Y FRAM Replacement

Abbildung, erster Prototyp im Programmiergerät

This project is not very big but still something special. On the one hand it is part of a restoration which has been prepared for years. On the other hand it seems that nobody has come up with the idea to replace a 5V NVRAM with a 3.3V FRAM or to publish it.

Problem components NVRAM

If you want to keep old devices for a long time, you will always come across chips with integrated lithium battery from “Dallas Semiconductor”, which was bought by “Maxim Integrated” in 2001, which in turn was bought by “Analog Devices” in 2021. These are mostly NVRAMs (non-volatile RAM) or RTCs (real-time clocks) with NVRAM. The battery integrated in the chip package enables the data in the RAM to be retained even after the operating voltage is switched off and the RTC continues to run. An NVRAM controller, which is also integrated, takes care of switching between battery and operating voltage as well as data protection when switching on and off.

Basically, this is a very practical solution, since one can use a single component instead of a whole circuit including battery. However, it is fatal when the built-in battery is exhausted after about 20 years. Almost always the whole device is no longer functional. The components are of course no longer produced. Also the remaining stock traded on the Internet is either already too old or even more often faked. I have bought two fakes myself. Thus, replacement with the original part is not an option.

Example photo of soldered NVRAM and RTC
Soldered NVRAM and RTC (Tektronix TDS754C CPU Board)

Replacement options

The replacement of RTC and NVRAM differs significantly.

The NVRAM can be replaced by a corresponding SRAM with NVRAM controller and battery. Some examples can be found on the net.

Another variant is the replacement by FRAM, a memory which can be written arbitrarily like RAM, but which keeps the content even without operating voltage. There are also examples with the FRAM types FM16(W)08 and FM18(W)08 with 64kBit and 256kBit size respectively. The charm of this solution is that no battery is necessary and thus the memory remains maintenance-free. Unfortunately, the two mentioned FRAM types are pin-compatible with the Dallas NVRAMs, but they are controlled somewhat differently. Thus the exchange unfortunately does not work in all devices.

An RTC cannot be replaced so easily. The RTC maps the time to a memory area that is accessed like “normal” RAM. The chip has to keep the required timing exactly. This can only be ensured by using dual-port RAM. However, I have not found suitable circuits. This would be a small project for the future. Currently, there is only the possibility to mechanically drill out an old RTC and connect a new lithium battery from the outside. Or you can use a compatible RTC chip, which is still available as residual stock. As far as I know this is only possible for a DS1486, which is replaced by a DS1386G incl. RAM and battery.

DS1250Y/DS1650Y FRAM Replacement

Now to the corpus delicti. The DS1250Y component from “Dallas Semiconductor” is a 4MBit NVRAM. The pin-compatible DS1650Y variant also has the option of write-protecting individual memory areas via software. Thus the DS1650Y can replace the DS1250Y. The other way around, this doesn’t work in every case, but only when the software doesn’t use the write protection feature or doesn’t depend on it.

A short component search for parallel 4MBit FRAM brings only one product to light, the FM22L16-55-TG. Unfortunately, it works with a maximum of 3.3V and has 16 bit data width in contrast to 5V and 8 bit on the DS1250Y.

So there are still some parts missing to adapt the FM22L16: Some logic, level shifter, a voltage regulator and some brain power. Difficult in the design was also that the whole circuit has to fit on a board with the size of the original part.

Circuit

After a couple of days of reading and understanding data sheets and drawing schematics, the circuit was ready.

Figure, DS1250 FRAM replacement circuit diagram
Circuit diagram

I used a bidirectional level shifter 74LVC8T245 for the data bus, a MCP1700T-3302E low dropout voltage regulator for the 3.3V power supply, a couple of universal single gates for the control logic and Schottky diodes and LEDs for the unidirectional level shifters of the address and control lines.

In the first version I had forgotten the pull-up resistors R3 to R5 which caused the data to be changed when the device was removed from the programmer. Otherwise, the circuit works flawlessly and easily meets the timing requirements of the original.

The unidirectional level shifters with a Schottky diode plus LED are still special and grown on my crap. I simulated the circuit and found that this simple way works safely and quickly.

Illustration, simulation of unidirectional level shifter
Simulation level shifter for address and control lines

The plan is available as a pdf here.

Contruction

The circuit is placed on a double-sided PCB, which is about 1mm wider than the original component. In most devices, however, there is enough space for it.

Abbildung, Layout
Board layout

Gerber Files for private reorder are located here. Usually I order at JLCPCB. There you can simply upload the zip for ordering. The bill of materials and the assembly plan are here.

The rest follows as a short picture story:

Figure, finished boards are there and are assembled
Finished boards are there and are assembled
Figure, components manually assembled and soldered
Components manually assembled and soldered
Figure, bottom view
Bottom view
Figure, bottom view, afterwards added pull ups connected with wire, modification added to published design
Bottom view, afterwards added pull ups connected with wire, modification added to published design
Figure, bottom view, pin header manually soldered from beside
Bottom view, pin header fiddly soldered from beside
Figure, first prototype in the programmer
First prototype in the programmer

 

Receive updates directly in your inbox

Loading

Bluetooth Audio Receiver with PCM5102A

Bluetooth Audio Receiver mit PCM5102A

We have a receiver in our living room that is almost exactly 50 years old. The Sony STR-V5 has a lot of oomph, is wired with wire-wrap connections like earlier space technology and will certainly work for another 50 years. The only problem was that its cinch inputs are no longer compatible with current devices that transmit wirelessly. This gave rise to the idea of building a slightly better Bluetooth receiver for the Sony with a matching retro look. The end result can already be seen here.

Receiver betriebsbereit
receiver ready

Bluetooth-Audio

Before this project, I had no idea about bluetooth. In my mind, it sounded pretty easy to transfer the audio and then play it back. Unfortunately, it’s not quite like that. Due to the limited data rate of a Bluetooth wireless connection, the data must be compressed. A “codec” does this. Of course, it has to be the same on the sending and receiving side. The oldest and currently the most widely used codecs are “AAC” and “SBC”. Audiophile users were not satisfied with the quality of this compression, so a number of new standards are trying to enter the market. In addition to “SBC” and “AAC”, “aptX”, “aptX HD” and “LDAC” are now also competing for the customer’s favor. Don’t forget: sender and receiver must support the same codec. For example, if you buy Bluetooth headphones with “aptX”, but the receiver speaks “LDAC”, only a connection with “SBC” is established, if it works at all.

Overall, the Bluetooth standard is quite complex and my interest in delving further into it is limited. The software uses “SBC”, which is supported by almost all devices.

Volume control

While programming, I noticed that the volume control with Bluetooth is the crux of the matter. The basic problem is that the audio samples are transmitted with 16 bits and usually 100% volume. In the receiver, the volume is now reduced to say 35%. That means we have to divide the audio samples roughly by 16. As a result, we have audio data with a resolution of only 12 bits. And that’s exactly how it sounds.

A simple solution to the problem is a 32 bit D/A converter. The received 16 bit samples are converted into 32 bit values ​​by simply adding zeros. It doesn’t make a difference at first. In the second step, however, we can calculate the volume with the 32-bit value and then send it directly to the D/A converter. As a result, there is no loss of information at low volume, the 16-bit information is retained.

I recently wrote an article about the secrets of a pleasant volume control.

Components

The heart of the circuit is an ESP32 microcontroller from Espressif. The system not only offers plenty of computing power for 3.50 euros, but is also energy-saving. There are a lot of code examples from the manufacturer and lively discussions in forums, which make application development and troubleshooting easier.

ESP-WROOM-32D Modul
ESP-WROOM-32D module

A PCM5102A from Texas Instruments with 32 bit and 112dB signal-to-noise ratio is used as a high-quality D/A converter. It’s actually way too good for Bluetooth audio, but the advantages of 32-bit pay off when it comes to volume control.

D/A-Wandler Board
D/A converter board

The whole is complemented by two buttons for volume and reset, a 128×64 pixel OLED display and a breadboard. For this project, I use ready-made modules that only need to be connected to each other. This is of course much faster than drafting your own circuit board.

Bauteile
components

Circuit

Since I used finished modules for the project, the circuit is limited to a few connections between the central ESP32 module and the OLED display, the D/A converter and the two buttons. The whole thing is soldered together in an hour.

Verdrahtung Unterseite
wiring bottom
Schaltbild
schematics

The circuit diagram is available here as a pdf.

Prototyp
prototype
Funktionstest
function test

Case

I built a small housing from glued plywood scraps, which has become very chic and goes well with the Sony receiver for my taste.

Gehäuse aus Sperrholz - Vorderseite

Gehäuse aus Sperrholz - Unterseite
case made of plywood, front and bottom

Software

The software is derived from the example “A2DP-SINK” from the ESP32 manufacturer Espressif. That shortened the development time a lot for me, as the complete and rather complex Bluetooth communication is already implemented in the example. I added processing of the audio samples for volume control and the conversion from 16 to 32 bits as described above. I also added the routines for the OLED display. The operating status, the connected device and a logarithmic level display are shown on the display.

In the end, the programming and troubleshooting took a lot longer than a weekend, as a lot of bugs had to be found and fixed.

I have published the full source code, the instruction manual and guidance for compiling the project on Github.

https://github.com/uhucrew/bt-receiver-pcm5102a

 

 

Receive updates directly in your inbox

Loading

dsPIC33 Experiments


Anyone who has read my article “Weekend project: bat detector” will have heard, that I was not fully satisfied with the result. The device is working but it’s too insensitive. This induced me to start from scratch and build it again. This time with digital technology which is better prepared for the task. The electronic key component is a dsPIC33E, a microcontroller with DSP functions from Microchip.

The Goal

The idea is to record the ultrasonic signal with microphones which are sensitive in the needed frequency range. Subsequent the amplified signal will be AD-converted with a sampling rate of 300kHz at least. After a spectral analysis with FFT the spectrum is indicated at a display. If possible the signal will be rendered audible by an inverse FFT after changing the sampling rate. This procedure should transform the gamut of the signal to lower frequencies, hearable for humans. As far as this coarse ideas become real and the project grows with all hardware, software and mathematics, I will certainly write something about it in this blog.

The Experiment

Initially I need a small system for digital signal processing. A preamp and signal conditioner at the input, AD-converter, a DSP or a fast microcontroller and at the end of the chain a DA-converter. The system shouldn’t lack a small display too. Nice to have would be a battery power supply and additional supply by USB.

block diagram with front end, AD-converter, DSP, DA-converter and power supply

Component Inquiries

Every time a project like this one starts with investigations on the components to use. Which microcontroller will be chosen, what kind of converters to use, how to build the power supply et cetera. These considerations leads to a pretty detailed block diagram as shown above.

Unfortunately some special components are not sold in small quantities and often only an B2B (business to business) selling platforms or with very high shipping costs. The DSP for instance I had to order as a sample directly at the manufacturer. At all I needed to place 3-4 orders. Because of SMD cases of some chips I had to solder these on small adapter boards to use the chips in my hand soldered prototype design on a stripboard.

adapter boards for several TSSOP and SSOP cases

Prototype

The orders arrived and some tinker evenings later the prototype was ready for some tests. I always do this step by step for each component.

prototype built on stripboard

Starting point was the oscillator, followed by the I2C bus, the OLED display and the AD/DA-converters. At this step I faltered. Every time it is fiddly to bring an SPI (synchronous serial interface) to work, especially at high data rates and if the default configuration of both sides does not match. To solve the problem I had to buy a new logic analyzer with 100MHz resolution. Root cause was the need of a signal /CONVST (conversion start) to trigger a conversion at the AD-converter. The CPU wasn’t able to generate this signal fast enough and especially not synchronous. As a way out I used the inverted signal /SS (slave sync) of the SPI as /CONVST. Conversions should anyway run synchronous to the SPI transfers which implies one transfer (/SS) follows one conversion (/CONVST).

To analyze the electrical signals during data transfers I use PulseView, an awesome open source software for logic analyzers including some amazingly cheap devices like Cypress EZ-USB FX2 based ones.

logic analyzer readout for SPI-interface of the MAX8328 AD-converter

After sailing around some difficulties with hard- and software it was a terrific moment to hear the first synthesized distortion free sinus tone.

Software

The software is mainly written in C. An integrated development environment, “MPLAB® X“, is provided by the CPU manufacturer which is freely available but has some limitations. More than an “-o1” is not allowed and leads to comparatively slow code. This is no problem at all here, time-sensitive parts are simply implemented in assembler.
By the way a tip for all users of GCC, AVR-GCC etc: It’s quite easy to integrate assembler code in C. Just add a file with “.s” or “.S” extension to the project and add your assembler code there. The file with the capital s extension will additionally handled by the preprocessor.

The latest version of the software is published on my Github-Account.

Hardware

The hardware is not yet perfect but good suited for further experiments. After all the system is able to process the input with 16bit at 384kHz mono or 192kHz stereo sample rate and output simultaneously 24bit at 192kHz stereo sample rate. At the same time the CPU is busy by a few percent only due to DMA transfers.

schematics, still without front end for microphones and line-in

Anyway for the next prototype some things I will improve, primarily to simplify the SPI programming.

  • dsPIC with I2S interface
  • dsPIC with at least 3 SPI interfaces and more IO ports
  • bigger and colored display
  • additional RAM, may connected to SPI port

More RAM would be great. The maximum on chip memory for dsPIC33 CPUs is about 50kBytes. A dsPIC33EP512GP806 in a TQFP64 case could be a good fit, a 32bit controller like the PIC32MZ1024EFH100 might be an excellent choice too.

preliminary finished evaluation board with programming adapter and logic analyzer in operation

Receive updates directly in your inbox

Loading