vrijdag 14 augustus 2009

PIC board working again

The PIC16F887A chips arrived yesterday.

I had to change some things as this chip is the A version. The broken chip is not an A version. After changing those settings the board worked again. Unfortunately this new chip does not solve the programming errors I sometimes get when using the Winpic programing software. Anyway I can continue working on the digital board.

I have changed the port for the switch. I try to use a port for either input or output. I don't want to mix input and output. In the previous configuration It was mixed. That may have destroyed the PIC.

Dependig on the switch setting I can change the center frequency or the frequency span. For each span setting a different sweep frequency must be used.
I use the PWM output to generate this sweep signal. I managed to make this frequency controllable. It now changes when the span setting changes.I am not satisfied yet. I can see the sweep signal make small jumps when a low sweep frequency is used. I want it to be smooth. I will adapt the software improve this behaviour.

Currently the software delays each output increase. this delay is adjustable. Effect is that the sample rate depends on this delay. So for low frequencies the lowpasfilter is not sufficient. I don't want switchable filters as it would require additional hardware. So I will try the approach used by a DDS. I will increase the output of the DAC starting at 0 to max using an adjustable stepsize. That way the sample rate will be fixed. Tonight I will try to implement this.

dinsdag 11 augustus 2009

Dac Driver ready


This picture shows the pic 16F877 board. It worked till I tried to reprogram it. The PIC is dead since.

Software development continues on a 16F84 board. I put one of the DAC chips on that board. Then I wrote a driver for it. This was not hard to do.

The DAC uses a 3 wire serial bus. The protocol is simple. I uses 4 control bits, 10 databits and 2 don't care bits. Sending these bits to the Dac can be done fast. I made a sawtooth generator as test project . The resolution is 10 bits the period is 2Hz. If the PWM sawtooth generator won't met the expectations I can fall back to this one.

I have to wait for the arrival of the new 16F877 chips. Until then I will work on the analog board. That board will adjust the amplitude of the sweep signal. It will also add the center frequency offset and the centerfrequency regulation voltages.
I may put a linearization circuit on this board.

woensdag 5 augustus 2009

DAC chips arrived

The DAC chips LTC1799 have arrived. They will be used to set the center frequency.
Unfortunately my PIC16F877 has been destroyed. I don't know why. Some new ones have been ordered. In the mean time I will use a 16f84 to develop a driver for this chip.

My DAC chips are dual DAC chips. I am considering to use the 2nd DAC for the center frequency control loop. The original plan was use an external integrator in the control loop but I may as well do it in software. New plan: use one 10 bit DAC's to set the center frequency. A lookup table will be used. The actual center frequency will be measured and corrected by a control loop. De 2nd DAC will output the control signal.

maandag 3 augustus 2009

The rotary encoder works. I used interrupts on pin state change to track movements. This works great. In previous projects I used polling. This caused problems for fast rotations.

It is possible to make the sweep (Sawtooth) using the PWM output. Just increase the duty cycle starting at 0% until the maximum is reached. Then filter the signal using a low pass filter. I have used a simple low pass RC filter at the PWM output. The signal looks good for slow sweep frequencies. For higher frequencies the ramp is not a straight line. I think it can be solved by using a higher order filter.

I have added a switch to select the function of the rotary encoder. Two modes are foreseen. Center frequency and span (MHz/division). In span mode the sweep frequency has to be adapted. Next step is to make this possible. I will try to clean up the ramp signal as well.
I bought some switches (4013) and opamps (TL072) to make a voltage divider for the sweep signal.

I have just ordered DA converters. They will be used to set the center frequency. I hope they will arrive soon.