Saturday, April 10, 2021

H632S-WC Weather Channel EZ Crank Radio Extreme

 

The crank is a 3-phase alternator driven by two-stage gears; the output is rectified by 6 diodes.   There is another diode between the bridge rectifiers and the output voltage.   The FM radio IC is CD9088CB, which can operate between 1.8V and 5V, drawing about 5mA.  The 8Ω 4W speak and earphone are driven by TDA2822M, a dual low-voltage power amplifier, which works down to 1.8V.  The rechargeable battery pack is a 3-cell NiMH for 3.6V.   Most other components are for the radio.   The rectified voltage is used for direct battery charging without regulation.  And the 5 parallel LEDs are powered directly with only small series resistors.  All the wire connections are fragile.   For a retail price of $15, we do not expect it to be a very robust construction.



The battery pack seems no longer can hold charge.  We'll replace it with a small 480mAh LiPo pack (1.2 x 1.0 x 0.3"), that costs about $6 and is a little smaller than the NiMH pack (1.2x1.2x0.42") .   We install a 2mm JST PH 2.0 2-Pin connector.

We bring out the voltage after the bridge rectifiers to the outside, so we can monitor the crank generator output and potentially use it to power other devices, such as other chargers.   The diode to the Lipo isolates the battery to these wires, so it is relatively safe.

When unloaded, the crank generates about 5-8V at a reasonable crank rate.  It can peak over 10V if cranked really fast.  When it is loaded with battery, the voltages does not exceed 4.5V; after diode drop, the voltage on the battery is only about 3.8V, so it is safety for the battery .  The generator can supply enough power to sustain the radio, but not the LED light.

We also connect the output to a boost regulator, that generates 5V.  We use the 5V to charge a Bluetooth earphone.   The generator puts out 4.4V/45mA, about 200mW.   The rectified output is not very stable.  If we take the output from the battery side, it's better.  If we use it to charge a smartphone, the crank cannot keep up and the internal battery drains first.


Wednesday, December 30, 2020

AC Termination

In the case of the RS422 circuit, the differential line impedance is around 100$\Omega$ and "Standard RS-422 drivers are guaranteed to source and sink a minimum 20 mA across a 100Ω load."  (The receiver sensitivity is 200mV.)  That's 40mW dissipated on the termination resistor, and it could be 100mW dissipation at the driver if powered from a 5V supply.  Since this power dissipation is constant regardless the data pattern, the AC termination should be considered.  The AC termination draws power only at the data transition.  How effective is the AC termination?  The AC termination is a resistor and a capacitor in series.  The resistor value matches the transmission line impedance, so about 100$\Omega$.   People seem to use a capacitor value from several hundreds picofarads to a few nanofarads.  How do you select the capacitor value?  If we look at the transmission ratio (the voltage at the termination vs the input voltage), it is $$2\frac{1+j\omega R C}{1+2j\omega RC}.$$If $\omega >> 1/RC$, the ratio is 1.  If we take $R=100$ and $C=1$nF, the frequency must be much greater than 1.6MHz.  This is much more than the usual baud rate we use.  

But the steady state analysis is not the right way to go.  The step response that we are interested in is a transient.  Consider a 1V step applied to the transmission line.  Initially, a 10mA current flows into the termination resistor and capacitor.  The voltage across the capacitor rises as it is charged; and the voltage starts overshoot and reflects back to source.  It can be shown that the reflected voltage is half of the voltage across the capacitor.   The overshoot rises as 2RC time constant and reaches the peak when the reflected voltage makes the round trip.   So the overshoot is depended on the length of the transmission line.  If the transmission line delay is 10ns (~6ft), there is about 10% overshoot with 100$\Omega$ and 1nF termination.

If the transmission line delay is 100ns, the overshoot is $1-\exp(-2\cdot100n/(2\cdot 100 \cdot 1n)) = 63\%$.

TI's AN-903 erroneously stated, ; then the overshoot would be 39% or larger.

But one thing that we have not considered is the source impedance.  The driver could have 10-20$\Omega$ output impedance or series resistors may be included.   When the source impedance is greater or equal to the termination resistance, there is no overshoot, instead there is just a step followed by exponential rise.  For this case, a small capacitor gives fast edges (necessary for high speed transmission).

Friday, December 25, 2020

Christmas LED Lights

I have a string of 60 LED Christmas lights with 6 distinct colors.  I measured the RMS current with a multimeter, and found to be 27mA, so it worked out to be about 3.2W or about 54mW each, which seems reasonable if each LED takes about 20mA.  The string appears to have 3 parallel segments, with 3 lights having 3 wire connections.  That means each LED string consumes 9mA, so the 54mW number seems high for each LED.  Four of LEDs (all blue color why?) are not working, but the rest of the string works, so the connection is maintained.  I was curious to take one off; that segment was out.  So it is the LED that provides the electrical connection.  I took it apart and measured the resistance an found it to be 90 Ohms both ways.  Is there a built-in parallel resistor for fault tolerance?   Each of these resistors would take about 10mW.  The LEDs are running directly off AC, so the current is measured as true RMS, but the voltage RMS is not known.  

Thursday, December 10, 2020

Anti Sulfur Chip Resistors

 Many automotive grade chip film resistors have the  anti sulfur feature.  Bourns has a white paper, "Advantages of Sulfur-Resistant Film Resistors".  It describes in good detail the construction.   In short, sulfur based gasses (such as caused pollution) can react with Ag/AgPd resistor terminal that leads to crack the package.  A Palladium (Pd) protection layer is added to the Ag terminal to eliminate the formation of Silver Sulphide and hence increases the reliability.

Thursday, August 27, 2020

Computer Software Notes

Windows

Change network setting with commands
netsh interface ip set address "Local Area Connection" static IP NetMask Gateway
netsh interface ip set dns "Local Area Connection" static DNS primary
netsh interface ip add dns "Local Area Connection" DNS index=2

Add Emacs to the right-click menu.  Add to the registry
[HKEY_CLASSES_ROOT\*\shell\Emacs\command]
@="\"C:\\Program Files\\emacs-22.3\\bin\\runemacs.exe\" \"%1\""

Emacs for windows needs the diff program to run ediff.  If cygwin is installed, in .emacs (setq exec-path (list "c:/cygwin/bin")) to use cygwin's diff.  Also set environment variable CYGWIN=nodosfilewarning.

Emacs over VNC sometimes could not use the Alt key, add the following to .emacs
;; Map Alt key to Meta
(setq x-alt-keysym 'meta)
For computer with with multiple networks, eg hardwire ethernet and WIFI.  To set the network order
Control Panel -> Network and Sharing Center -> Change adapter settings -> The hit Alt to get the menu and choose Advanced -> Advanced Settings.

Screen saver timeout may have to be changed in the registry
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop]
"ScreenSaverIsSecure"="0"
"ScreenSaveTimeOut"="900"

Microsoft mouse software Intellipoint messes up the left handed setting.  Uninstalled it.

Microsoft robocopy is a useful tool for backups. The command  "rmdir /s/q folder" is a much quicker way to delete a large folder than through Windows interface.  [Others have pointed out a combination of "del /f/s/q foldername > nul" and "rmdir /s/q foldername" is even faster.]

Xilinx USB cable does not install incorrectly with ISE 11.1.  Manually running the following solves the problem,
cd C:\Xilinx\11.1\common\bin\nt
wdreg -inf windrvr6.inf install

Xilinx Platform Studio 7.1 cannot coexist with ISE 11.1. The PATH environment variable should contain either 7.1 or 11.1.

Foxit Reader is a better PDF reader than Adobe Acrobat Reader.

Matlab "Failure to find requested data acquisition device: nidaqmx."  Run Matlab as Administrator.

The driver for Proflic PL2303 based USB to serial adapter uses much more interrupt time than others.

Windows 7 jump lists are in %AppData%\Microsoft\Windows\Recent\AutomaticDestinations, deleting the large files helps restoring the lists.

Windows 7 does not include hyperterminal; copy the following files from Windows XP.  Hyperterminal does run on Windows 7.
c:\Program Files\Windows NT\Hypertrm.exe
c:\Windows\System32\hypertrm.dll

Hyperterminal can send ascii code by pressing and holding down ALT and entering numbers from the numeric keypad (with Num Lock on) then releasing the ALT key.  The code is sent upon the release of the ALT key.

xfig on cygwin complains about missing fonts.
cp /usr/share/ghostscript/fonts/*l.pfb /usr/share/fonts/Type1
cat /usr/share/ghostscript/fonts/fonts.scale >> Type1/fonts.scale
Change the first line to the number of fonts listed.
Update the font database:
mkfontdir

com0com creates a pair of virtual com port.

Laptop PC generates excessive fan noise even when there is little user activity.  The solution is to create a power plan that uses passive cooling, which reduces CPU speed first before increasing fan speed.  Furthermore limits the maximum processor state to 75%; that reduces the CPU frequency.  Power Options -> Create a power plan -> Change plan settings -> Change advanced power settings -> Processor power management -> Maximum processor state .

Linux

To clone a linux system to a large disk.
cp -ax /olddisk/. /newdisk
sed 's/`vol_id --uuid /dev/olddisk`/`vol_id --uuid /dev/newdisk`/g' /boot/grub/grub.cfg > /newdisk/boot/grub/grub.cfg
grub-install --boot-directory=/newdisk/boot /dev/newdisk
sed 's/`vol_id --uuid /dev/olddisk`/`vol_id --uuid /dev/newdisk`/g' /etc/fstab > /newdisk/etc/fstab


To keep the xterm open after executing a command with -e option,
xterm -hold -e 'command' 

To set up a remote git repository from a local repository
#Remote machine: Create the bare repository
mkdir proj.git
cd proj.git
git --bare init

#Local machine:
git remote add origin ssh://remote-machine///repository/proj.git
git push origin master
git checkout origin/master
#Create the local "master" branch that is tracking the "origin/master" branch
git branch -f master origin/master
git checkout master


To make an existing branch tracking a remote branch
git branch --set-upstream master origin/master

To fix a problem with acroread menu on Ubuntu,
"export UBUNTU_MENUPROXY="acroread":$UBUNTU_MENUPROXY
or disable global appmenu altogether
sudo sh -c "echo export UBUNTU_MENUPROXY=0 > /etc/X11/Xsession.d/81ubuntumenuproxy"

When partition a USB drive for Linux and Windows, place the Windows partition first.   Windows can only read the first partition from a USB drive.  The Linux can boot from the second partition.

To map the mouse buttons in X Windows
xinput list
xinput set-button-map 12 1 2 3

To create a pair of virtual serial ports 
socat -d -d pty,raw,echo=0 pty,raw,echo=0

The password length and complexity are controlled by
/etc/pam.d/common-password

The hardware clock setting is in /etc/default/rcS
UTC=yes
to set to UTC time.

Environment variables for Desktop, .pam_environment, the following may be needed to prevent undesirable scaling
QT_AUTO_SCREEN_SCALE_FACTOR=0

Monday, August 3, 2020

Tile Tracker

Powers off 3V CR2032 lithium coin battery
One piezo buzzer
Toshiba's TC35678FSG BLE 4.2 Cortex-M0 (13 or 26MHz) 384KB ROM, 192KB RAM, 256KB Flash.
Diodes PAM8904 12-pin U-QFN3030-12 18VPP output piezo sounder driver, charge pump
Could not identify the two other ICs


  


Monday, July 20, 2020

FPGA Design on Linux

I'm dusting off an old Digilent Nexys 2 board with a Xilinx Spartan 3E FPGA.  The older FPGA devices are not supported by Xilinx Vivado, and the last version of ISE is 14.7 (2013).  The free webpack license is sufficient.  The Linux install file is about 6.5GB; the installation would take 18GB.   It installs fine except for the cable drivers.  It appears that when trying to build windrvr6.ko kernel module, there is an error "fatal error: linux/config.h: No such file or directory" because Linux does not have config.h.  Because we plan to use Digilent's Adept interface, it is not crucial that we have the Xilinx cable driver.  Instead we install Digilent's adept utility and runtime.

After sourcing Xilinx setup script, we can run ise to start ISE Project Navigator.  Then the graphic interface guides us to create the project and run the implementation and generate the bit file.  Then we use the adept utility djtgcfg to program the FPGA.

Subsequently, it might be easier to run the command line interface.  We can turn the command log into a batch script.

The design can be simulated with ISim Simulator.  Now we have a Xilinx FPGA development environment on Linux.

The Linux version of Microsemi's Libero SoC is also available.  We install Libero SoC v11.9 for the ProASIC3 devices.  But we run into a problem with the license.  We request a free sliver license and install Linux Licensing Daemon.  We run lmgrd to start the license server, but license checkout for synplifypro_actel is unsuccessful: The license key and data for the feature do not match. It turns out that I forget to set the environment variables. That gets the synthesis going. Compile does not work and gives an error message of
"Unable to open a working copy of adb file: checksum error detected. The specified file may not be an Actel design file or may be corrupted."
and another message of
"Wind/U Error (248): Failed to connect to the registry on server Cannot register service: RPC: Unable to receive; errno = Connection refused" .
I tried the suggested solution of allowing TCP connections to Xserver. But it does not work.