dinsdag 30 juni 2009

sweep generator

I am renovating my house so I have not much time to work on the project.
Nevertheless I am thinking about the design of sweep generator.

The span (MHz/division) must be controlled by the microcontroller. So I think I make a sawtooth wave generator followed by a programmable attenuator. I found some cheap digital potentiometer chips that should do the trick.
They have 64 taps. This is not enough. I need more resolution as I want the following spans:
500 KHz/div
1 Mhz/div
2 Mhz/div
5 MHz/div
10 Mhz/div
20 MHz/div
50 MHz/div
and 500 MHz full screen.

I think it can be done by cascading two of those potentiometers. Then I get 64*64 different spans. Resolution will be 500/(64*64) = 122 KHz. That should be enough.

maandag 29 juni 2009

Programmer issues

I built a PIC programmer for in circuit programming. As mentioned earlier in the blog it is the SERPIC programmer. It caused me a headache because it did not work properly. It took me an evening to pinpoint the problem.

I have also built a small PIC target board to test the programmer. It contains a 16F84 and one led. It can be used to send my call sign in Morse code.

After I built it it seemed to work. The SERPIC programming software verifies the program by reading it back. No problem was reported. Nevertheless, the program would not run at all. I used the JDM programmer to read the contents. It looked fine. Then I programmed the PIC using the JDM programmer. Now the software runs fine.After erasing the PIC I was able to program the PIC correctly. The next programming attempt failed.

So it seems necessary to erase the PIC first. This was a surprise to me. I have used a simple programmer (direct connection) and this programming software (spp) for years. Erasing was not needed. At least it was not done explicitly. I changed the batch file to erase first then program. Now it works.

I may not be out of the woods yet. One of my PIC seems to be protected although I did not protect it . Another one is not programmable. Writing fails at the first word. Those processors could be damaged. Or the programmer still has issues . Anyway, now I have a target board that I can program over and over again.

Validation of the programmer was done on an old win98 PC using old programming software. I did this to test the SERPIC programmer in a familiar environment. For the software development I will use different software and a more modern PC.

maandag 15 juni 2009

Update frequency regulator



After doing some calculation I decided to make a change to the concept.

The integration time of the integrator must be long. After all the frequency measurement is slow, especially for slow sweeps. It takes at least one period of the sweep signal to measure the frequency. During that time the output of the integrator should not change much. This implies a slow loop. Beside that the gain of the voltage/frequency converter is high. It is 500 MHz/24Volt. So a small ripple or noise will cause a big frequency change. To suppress this a large integration time is needed. Maybe some additional filters are needed as well.

A slow loop makes frequency changes very slow, this is not convenient. My solution is to add a DAC to set the course frequency. The integrator Will be used for fine tuning. The DAC is an 8 bit one so the course frequency step is 500MHz/256 = 2 MHz. Now the influence of the integrator is way less that it was before. It needs to be able to change the frequency only 2 MHz maximum instead of 500 MHz. So the ripple is reduced by a factor 250. The filter requirements can be relaxed because of this. Open loop gain is reduced as well. This decreases the complexity of the regulator algorithm.

vrijdag 5 juni 2009

Arrival of NE604 chips

Those NE604 chips are expensive. They cost 8 euro a piece.So I bought some on Ebay. Ten of them for 30 euro including postage, that is a good deal. They have arrived this week. It is the smd version so using them will pose a challenge. Nothing I can't handle though.

PIC programmer works

I managed to install XP on the old PC. It had to be the oldest version of XP I could find. The latest version won't install on a 1.2 Giga Byte hard disk. I won't connect the PC to the web so it is save to use.

I was afraid it would be hard to make the PIC JDM programmer work on XP. Fortunately it worked fine. The program I use is WIN PIC. It can be configured to use win API calls for accessing the serial port so I won't get port access problems. However I had to set win98 compatibility mode. Without this setting I got system errors.

I'll make a in circuit programmer. It will be the SERPIC programmer designed by David Tait. This programmer is also supported by WINPIC.

woensdag 3 juni 2009

spectrum analyser frequency control


The picture shows the control part of the spectrum analyser.
I try to make it a bit more sophisticated than the control I found in several designs.
Most designs use a potentiometer to set the center frequency, the sweep speed and the amplitude of the sweep signal. The better onces include a frequency counter.

The concept:
The Sawtooth generator is started by the PIC micorcontroller. If one cycle has finished it notifies the PIC. This way the PIC can calculate the sweep frequency accurately.
During the sweep the PIC counts the LO/256 frequency it receives from the tuner. Now the PIC is able to calculate the center frequency. This frequency is compared with the intended center frequency. Depending on this comparison an up or a down signal is send to the integrator. The integrator provides a DC offset voltage that sets the center frequency. The signal from the sawtooth generator is added to the offset voltage. Usually the VCO in the tuner is not linear. To compensate this non linearity a linearizer is added.

I am not sure the concept will work. It may be too slow. The regulation may be too crude.Experimentation is needed to find out.

dinsdag 2 juni 2009

Microcontroller development environment

In my daily job I develop software. I like my job but I don't want to spend my free time programming. So I chose a extremely simple c compiler and build environment for my electronics projects. It runs on a Pentium 1 system. The compiler is DOS turbo vision application for those old enough to remember it.

Unfortunately I can not use it for this project. It can not handle the PIC 16F877. So I have to switch to something modern. I found the HI-TEC compiler on the net. HI-TEC a free version without memory limits. Only the optimization is limited. So I will use this compiler together with MPLAB
from microchip. To program the PIC I can use the JDM programmer I bought on Ebay some time ago. However I want to program it in circuit. Fortunately the PIC16F877 can be programmed via the serial port. I found a bootloader for that. I think will try this approach.

In know the PIC can be programmed serially using 2 pins. I used them in previous 16F84 projects.
The programming software I know of uses either the serial port or the parallel port. I a afraid It won't run on XP because XP forbids low level access to the ports. Maybe I can find programming software that works under XP . Alternatively I can use the crack to enable access to the ports.

Of course I need a better PC than the Pentium 1 machine. Fortunately I have a few Pentium 3 PC's that can run XP. I hope I will be able to setup the development environment quickly. Because I want to concentrate on the application.