30 September 2008

My first Atmel program

I have been able to program an ATtiny2313 with a very simple setup:
  • 1 DB25, 3 resistors and one 20-pin socket
  • avreal32 Win software
  • computer with a parallel port ("LPT")
Even the laptop was able to drive the programmer. Although the female lab personnel (AKA wife) said the programmer doesn't look trustworthy, it did the job.

I can both read and write the uC. The "reading" ability is a huge improvement from my serial PIC16F84 write-only programmer, since I can write the chip and then verify what was written on it. This is how I know the chip was programmed with my code.

The commands for my LPT1 and my programmer:
READ: avreal32 +TINY2313 -ap -p1(0x378) -o0 -r a.hex
WRITE: avreal32 +TINY2313 -ap -p1(0x378) -o0 -w -c b.hex

Reading the chip displays:

v1.26rev0 (Aug 7 2008 17:52:48) http://www.ln.ua/~real/avreal
bug-reports, suggestions and so on mail to [censored]
Command: +TINY2313 -ap -p1(0x378) -o0 -r aaa.hex
Power ON
Device connected, TINY2313 detected
Chip not locked
OSCCALs = 68 6A
SUT = 2
DWEN = 1
Reading CODE memory
.... done
Reset pin released
Power OFF

Fuse values are displayed in decimal, while the datasheet lists their meaning bitwise.

Unfortunately the success was only partial, since the uC didn't seem to produce any activity out of the programmed code.

25 September 2008

Optical system going NLOS

Thanks to the interest of a colleague in my optical experiments, I sped up the work on my MCW light receiver.

Using a 10mm red LED at ca. 30mA and the OPT201 without any lens or post-amplification I could make some spectrograms with Spectrum Laboratory.

First of all I studied the environment: the incandescent bulb produced a clear set of harmonics every 50 Hz, with those at n*100 Hz being stronger ("1"). Then the 520 Hz line is definately the laptop TFT dimmed backlight ("4"), since at full brightness the signal disappears. Notice the result of a mixing between 488 Hz MCW signal and the strongest 100 Hz harmonic ("2"): this certainly occurs at electrical levels, not optical.

Next was a ca. 4.5m LOS test, with the LED light overloading the sensor. Even the cameraphone could see it:

I used my CW memory keyer to send a meaningful message (pre-recorded holiday CQ) at the lowest possible speed, about QRSS0.5 (0.5 seconds per dot).

In total darkness except the laptop screen, the spectrogram looked like this:

A quick test at 15 WPM revealed a perfectly readable signal. The shade effect of a hand obstructing the light beam is surprisingly strong. A wav recording is available, if anybody wants to hear it.

Then I moved the TX further away in another room, for a total of 11.5 metres Non Line Of Sight (NLOS). Only after my eye had adjusted to darkness I could see some weak red reflections on objects in the intermediate room, but the spectrogram was faster:

There it is! My QRSS CQ was on the screen, fortunately not masked by the laptop backlight. Remember the receiver had no focusing lens whatsoever.

I forgot to measure the response of OPT201 with a 3.3 Mohm series feedback resistor. Next test could be 300m LOS still without lens on the receiving side.

Stay tuned! Or better.... watch out! :-)

22 September 2008

NiMH constant current charger

I started working on this circuit long ago, and never used it thoroughly.

Given that NiMH cells can be slow-charged at a constant current rate for a given amount of time, I built this circuit. Provided the timed slow-charge condition is verified, you can live without end-of-charge algorithms.

Some charging facts (if I remembered where I read this, I'd credit the author).
A NiMH cell, if charged at C/10, in 10 hours will reach approx. 66% of the fully charged state. You achieve the remaining 33% with 5 more hours. That's where the magic 15 hours come from.

My constant current circuit required a PNP transistor. I picked a BD646 from the junk box in a TO220 package. Since the transistor had to be floating from ground, I needed a way to attach it to the metallic enclosure for thermal dissipation without electrical contact.
Forgot about nylon screws, a search through the electronic junk showed this solution: wrap the transistor in what I believe to be a mica foil and then press it against the heatsink/box.

This is how it looks like:

I recharged a 9.6V pack while watching the temperature and the current. The transistor runs barely warm, while the power resistor heats up considerably.

The pack under charge will increase its voltage, thus effectively reducing the charge current, in a auto-stop fashion. But since this occurred quite early in my charge cycle, I had to increase the input voltage to more than 14V.

One word of caution about the plugging sequence.

Charge start: connect the power supply and then the battery pack
Charge end: disconnect the battery pack and then the power supply

Otherwise the pack will discharge into the power supply. Probably a 1N400x diode on the +Vcc line blocks the process and allows to use a timed AC socket.

02 September 2008

The Amateur's Code

I'm copying and pasting this text here for future personal reference. A Good Reading anyway!

The Radio Amateur is

CONSIDERATE...never knowingly operates in such a way as to lessen the pleasure of others.

LOYAL...offers loyalty, encouragement and support to other amateurs, local clubs, and the American Radio Relay League, through which Amateur Radio in the United States is represented nationally and internationally.

PROGRESSIVE...with knowledge abreast of science, a well-built and efficient station and operation above reproach.

FRIENDLY...slow and patient operating when requested; friendly advice and counsel to the beginner; kindly assistance, cooperation and consideration for the interests of others. These are the hallmarks of the amateur spirit.

BALANCED...radio is an avocation, never interfering with duties owed to family, job, school or community.

PATRIOTIC...station and skill always ready for service to country and community.

--The original Amateur's Code was written by Paul M. Segal, W9EEA, in 1928.

[...meanwhile in the lab a constant current NiMH battery pack charger has been completed and tested...]