Support QRP CoA Everywhere

Saturday, 29 August 2009

M1KTA QRP TCVR - s, vswr and voltage meters



Ok added the feedback for the VSWR, rig PSU and smeter.
I will have to play with the callibration of the smeter but that should be easy enough. Right now just the voltages are displayed as I will need to refine the amplifier and/or voltage divider networks correctly to get them right. When that works I'll flip the smeter over to bars running againt the meter scale on the second row. The vswr also should update the power out level.

The ADC are only running as 8bit which seems to be more than enough, will be using a 5V reference (4.913V or something like that).

The smeter is probably the most complex to get right:
The way it will work is a voltage (in volts) for the S-meter output of the receiver for each S meter reading was be measured.

S0 2.400V
S5 2.412V
S5 2.431V
S7 2.497V
S8 2.578V
S9 2.561V
S9+10 2.755V
S9+20 2.895V

FSD is just 0-500mV

Then I could use the ADC value to determine the s-meter reading.

An alternative is I might use the method qrp2004 applied and not bother with any of this and just record the S9+20 level as the maximum signal and the S0 level as the minimum signal. You can then use fractions of the voltage at S9+20 stored in a lookup table for the different smeter values and the the S-meter reading can be determined. The reason why this might be better is that you can callibrate the smeter. It is probably all relative anyway.

The PIC mikrobasic isn't rocket science. I basically have signals coming into PortA.0, PortA.1 and PortA.2 of the PIC16F877A which are operating as ADC and that converts the values.

An early set of code was:

sub procedure lcdvolts
Lcd_Cmd(LCD_CURSOR_OFF) ' Cursor off
Lcd_Out(2, 30,"V")
end sub

sub procedure voltmeter

'volt meter NB right now FSD is 4.99V!
adc_rd = ADC_read(2) ' get ADC value from RA2
tlong = adc_rd*5000
adc_rd = tlong >> 10
ch = adc_rd div 1000 ' prepare value for diplay

Lcd_Chr(2, 26, 48+ch) ' write ASCII at 2nd row, 26th column
Lcd_Chr(2, 27, ".")

ch = (adc_rd div 100) mod 10
Lcd_Chr(2, 28, 48+ch)

ch = (adc_rd div 10) mod 10
Lcd_Chr(2, 29, 48+ch)

end sub

sub procedure lcdsmeter
Lcd_Cmd(LCD_CURSOR_OFF) ' Cursor off
Lcd_Out(2, 1,"1 3 5 7 9")
CustomChar1(2, 10)
CustomChar2(2, 11)
CustomChar3(2, 12)
CustomChar4(2, 13)
end sub

sub procedure smeter

'smeter NB right now FSD is 4.99V!
adc_rd = ADC_read(0) ' get ADC value from RA0
tlong = adc_rd*5000
adc_rd = tlong >> 10
ch = adc_rd div 1000 ' prepare value for diplay

Lcd_Chr(1, 9, 48+ch) ' write ASCII at 1st row, 9th column
Lcd_Chr(1, 10, ".")

ch = (adc_rd div 100) mod 10
Lcd_Chr(1, 11, 48+ch)

ch = (adc_rd div 10) mod 10
Lcd_Chr(1, 12, 48+ch)

ch = adc_rd mod 10
Lcd_Chr(1, 13, 48+ch)

end sub

sub procedure lcdvswr
Lcd_Cmd(LCD_CURSOR_OFF) ' Cursor off
Lcd_Out(1, 37,"SWR")
end sub

sub procedure vswrmeter
'vswr NB right now FSD is 4.99V!
adc_rd = ADC_read(1) ' get ADC value from RA1
tlong = adc_rd*5000
adc_rd = tlong >> 10
ch = adc_rd div 1000 ' prepare value for diplay

Lcd_Chr(1, 32, 48+ch) ' write ASCII at 1st row, 32nd column
Lcd_Chr(1, 33, ".")

ch = (adc_rd div 100) mod 10
Lcd_Chr(1, 34, 48+ch)

ch = (adc_rd div 10) mod 10
Lcd_Chr(1, 35, 48+ch)

ch = adc_rd mod 10
Lcd_Chr(1, 36, 48+ch)
end sub


Now trying to figure out the I2C or SPI routines to control the DSP and DDS as they will be on a separate dsPIC and PIC or AVR.

Friday, 28 August 2009

M1KTA QRP TCVR (was HB-1A - KX1 Clone)





The control project is a little way off complete and circuits are still all over the place and got to pull it together into a single PCB but I seem to be getting there.
Once complete and if I turn it into a kit and anyone interested in building I will try and obtain a few more of the 2x40 displays. But back light versions. I have to find some foil for a backlight yet for the current version, I did have fun modifying an old 2x16 without back light using 1mm perspex and 4 blue LED which worked!

I was running out of space on a 2x16 LCD and a menu scroll etc was a nightmare to implement so remembered the 2x40 displays from W8DIZ and gave them a go.

Anyway this is the mock up (I have used a EasiYo yoghurt cardboard box as it is a great size for the final rig) of the display and panel, not added the push bottons or rotary controllers yet. There are 12 buttons and 5 rotary controls. I bought 10 push button rotary encoders off ebay for <£1 each so some might be combined.
The LCD shows:

Top row:

My callsign, VFO status, Frequency (+ means RIT active above TX), C= CW, The measured VSWR is 1:1.76 and DSP is enabled

Second Row:

RX signal is +40dB, the enabled option switches (should not have VFO A and VFO B shown should be one or the other!), PSU voltage, output power level set (the S meter area will do duty as a modulation meter on TX), IF crystal filter enabled although I need to implement the BW as using a variable band width crystal filter 400Hz to 2.8KHz the power output area will double up to display the BW on TX.
Some options can appear to be seleceted even though on RX. This a bug in the firmware.

There seems to be plenty of extra 'LCD real estate' left. If need it might remove the M1KTA bit too. The little man to the right of M1KTA is aa bit of fun and is the identifier for rig tuning speed. He runs from left to right and back again. The faster he runs the faster the tuning. If LOCK is enabled he stands still and there is a stop sign. Here is a little video of it, normal, lock applied and then fast tune.


The ticks will be on the panel but the LCD show which controls are active, I used character $FF to display the option if enabled which is just a filled block, I might change this and the list.
The ticks show (similar to K2 list):

Noise Blanker
Antenna 2 Active
Pre Amp (Simple BF988 thing)
Attenuator (10dB attenuator - not rocket science)
VFO A
VFO B (shouldn't show both VFO on.. must be a bug!)
RIT obvious
XIT obvious

I expect I will add split too

On the RHS (a hang on from 2x16LCD and I will move these are the two options for:
DSP - Meaning DSP
FIL - Meaning Filter (should add bandwidth in the power area on TX)

Modes are C (cw), S (ssb) maybe U (usb), l (lsb), P (psk).

The rig is AD9851 DDS with DC RX standard NE602, Crystal IF and/or dsPIC DSP and LM386 chain. TX is direct from DDS (CW) or SSB rig using a combination of ideas from KK7B, KD1JV, G4GXO etc... to be honest what worked and I had components for.

I think I can have RX different to TX but not implementeted it.

When works will also add isolated audio outputs for computer connections and possibly SD card recording capabilities.

The original idea was to create a HB-1A/KX1 clone but I added SSB and PSK.

Tuesday, 25 August 2009

dsPIC and DSP audio filter addition to QRP project

OK played abut a bit more with the PIC 16F877A and got most of the commands working for the VFO, dropping the dual VFO for the moment as think might have to go to dual PICs for that.

In the meantime looking at dsPIC capabilities and designed a first filter. 400Hz to 2.8KHz band width, using a P30F4013 (as have one!). This might go nowhere...


' Author M1KTA, dombaines@yahoo.com
' Date/Time: 25/08/2009 13:36:28
' Device setup:
' Device name: P30F4013
' Device clock: 080.000000 MHz
' Sampling Frequency: 20000 Hz
' Filter setup:
' Filter kind: FIR
' Filter type: Bandpass filter
' Filter order: 20
' Filter window: Rectangular
' Filter borders:
' Wp1: 400 Hz
' Wp2: 2800 Hz

const
BUFFER_SIZE = 32
FILTER_ORDER = 20
COEFF_B as Word[FILTER_ORDER+1] = (
0xFD0A, 0x00D8, 0xFE5F, 0xF592, 0xEB3C, 0xE6EC,
0xEEB0, 0x0316, 0x1DE4, 0x3493, 0x3D71, 0x3493,
0x1DE4, 0x0316, 0xEEB0, 0xE6EC, 0xEB3C, 0xF592,
0xFE5F, 0x00D8, 0xFD0A)

LOAD_PIN = 4 ' DAC load pin
CS_PIN = 5 ' DAC CS pin

dim
inext as Word ' Input buffer index
input_ as Word[BUFFER_SIZE] ' Input buffer

' This is ADC interrupt handler.
' Analogue input is sampled and the value is stored into input buffer.
' Input buffer is then passed through filter.
' Finally, the resulting output sample is sent to DAC.
sub procedure ADC1Int org $2A ' ADC interrupt handler
dim CurrentValue as word

input_[inext] = ADCBUF0 ' Fetch sample

CurrentValue = FIR_Radix(FILTER_ORDER+1,' Filter order
@COEFF_B, ' b coefficients of the filter
BUFFER_SIZE, ' Input buffer length
@input_, ' Input buffer
inext) ' Current sample

inext = (inext+1) and (BUFFER_SIZE-1) ' inext := (inext + 1) mod BUFFFER_SIZE;

while SPI1STAT.1 = 1 'wait for SPI module to finish, if doing something
nop
wend
LATF.CS_PIN = 0 ' CS enable for DAC
SPI1BUF = $3000 or CurrentValue ' Write CurrentValue to DAC ($3 is required by DAC)
while SPI1STAT.1 = 1 ' Wait for SPI module to finish write
nop
wend
LATF.LOAD_PIN = 0 ' Load data in DAC
LATF.LOAD_PIN = 1 '
LATF.CS_PIN = 1 ' CS disable for DAC

IFS0.11 = 0 ' Clear AD1IF
end sub

' This is Timer1 interrupt handler.
' It is used to start ADC at
' periodic intervals.
sub procedure Timer1Int org $1A ' Timer1 interrupt handler

ADCON1.1 = 1 ' Start sampling
ADCON1.15 = 1 ' Start conversion

IFS0.3 = 0 ' Clear TMR1IF
end sub


' Main program starts here.
' Firstly, hardware peripherals are initialized and then
' the program goes to an infinite loop, waiting for interrupts.
main:
' DAC setup
TRISF.LOAD_PIN = 0 ' LOAD pin
TRISF.CS_PIN = 0 ' CS pin
LATF.CS_PIN = 1 ' Set CS to inactive
LATF.LOAD_PIN = 1 ' Set LOAD to inactive

' SPI setup
SPI1_Init_Advanced(_SPI_MASTER, _SPI_16_BIT, _SPI_PRESCALE_SEC_1, _SPI_PRESCALE_PRI_1,
_SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH,
_SPI_ACTIVE_2_IDLE)

inext = 0 ' Initialize buffer index
Vector_Set(input_, BUFFER_SIZE, 0) ' Clear input buffer

' ADC setup
TRISB = $FFFF ' Use PORTB for input signal
ADCON1 = $00E2 ' Auto-stop sampling, unsigned integer out
ADCON2 = $0000
ADCON3 = $021A ' Sampling time= 3*Tad, minimum Tad selected
ADPCFG = $0000 ' Configure PORTB as ADC input port
ADCHS = $000A ' Sample input on RB10
ADCSSL = 0 ' No input scan

' Interrupts setup
IFS0 = 0
IFS1 = 0
IFS2 = 0
INTCON1 = $8000 ' Nested interrupts DISABLED
INTCON2 = 0
IEC0 = $0808 ' Timer1 and ADC interrupts ENABLED
IPC0.12 = 1 ' Timer1 interrupt priority level = 1
IPC2.13 = 1 ' ADC interrupt priority level = 2

' Timer2 setup
PR1 = $03E8 ' Sampling = 20000 Hz. Value of PR1 is dependent on clock.
T1CON = $8000 ' Timer1 ON, internal clock FCY, prescaler 1:1

while true ' Infinite loop,
nop ' wait for interrupts
wend
end.

Friday, 21 August 2009

PIC DDS

Starting to put together code for DDS using a rotary controller. Using AD9951, PIC 16F877A, a cheap £1.09 ALPS encoder from Farnell, a 2x16LCD and a keypad £3 from Maplin.

The spec is:

1) DUAL VFO, that is VFO A, VFO B and A=B facilities.

2) UP to 50 spot frequency stored in MEMORY.

3) Three modes of operation

a) DIRECT where the frequency output has no offset displayed.

b) VFO MODE, where a frequency offset (IF) is applied VFO+IF, VFO-IF, IF-VFO).

While in this mode, VFO A or B is displayed on the top line of the LCD.

b) MEMORY MODE, where the encoder is used to select a previously saved frequency. While in this mode, MEM is displayed on the top line of the LCD.

4) KEYPAD Frequency entry and additional 7 Press buttons for other functions.

The remaining Functions included in the KEYPAD itself.

5) UP/DOWN fast search in three different steps using KEYPAD which is user selective.

6) SCAN and quick UP/DOWN search in three different steps with auto Repeat on PTT.

7) Frequencies are entered in MHz, the * is used to enter a decimal point,

and the # is used to ENTER the completed frequency.

If the first digit entered is the #, the number entered will be negative.

8) S- Meter reading from S0 to S9+40db in logarithmic db range.

9) Variable rate tuning to use cheap mechanical encoders.

10) Step size can be changed from 1Hz to MHz range.

11) RIT facility.

12) VFO copy to MEMORY and from MEMORY to any VFO (A/B) facility.

13) AM/LSB/USB/CW modes Operation with PIC pin outputs for switching.

14) Allows -Ve and +Ve IF OFFESTS. Offset frequency = any value from min RX frequency to Max 999MHz

15) 10 RX BANDPASS filter selection for RX coverage from 1.5MHz to 30MHz. Usefull to set up an All band RX.

16) BAND PASS filter switching selectivity 1Hz and 1ms switching speed, which allows cross band Operation.

17) CW OFFSET adds to TX Frequency when transmitting thus avoids modulated CW.

18) Save to MEMORY and Copy from MEMORY functions.

19) Scan VFO frequency and Scan MEMORY facility

20) Time out function for ignoring any wrong entry in system settings.

21) Auto repeat function for respective keys.

22) Display Multiplier Option to use with VHF rigs

23) Menu screen allows user to change any settings in the setup screen.

24) All settings can be changed in the SETUP screen at any time even when the DDS is in working mode including DDS chip type and Reference Clock.

25) SPLIT operation

26) CW OFFSET adds to TX Frequency when transmitting thus avoids modulated CW.

Coding PIC with MikroBasic from www.mikroe.com which creates asm which I then can compile with MPASM to HEX and burn to PIC.

Some code started out life as examples from them.

First play...to confirm can work out direction:


'PortA.0 is "A" Input
'PortA.1 is "B" Input
'"A" is direction indicator based on rising-edge of "B"; 1 = CW, 0 = CCW

dim b_old as integer
dim b_new as integer
dim counter as integer

TRISA = 000011
PORTA = 0
counter = 0

IF (PORTA AND 2) XOR b_old <> 0 THEN 'test for encoder change on "B"
b_new = PORTA AND 2
IF b_new > b_old THEN 'test if "B" is rising edge
IF (PORTA AND 1) = 1 THEN '"A" value is direction...1=CW, 0=CCW
inc(counter) 'increment counter
ELSE
dec(counter) 'decrement counter
END IF
b_old = b_new 'update b_old after changes
END IF


This little example uses the 7 seg display and one of the cheap encoders from farnell...


' Declare Variables
Dim NewRead, OldRead, TempRead, i As BYTE
Dim Rotation As Boolean

' Procedure to figure out what is the rotation direction
Sub Procedure Direction(Dim Rotation As Boolean)
If Rotation = 1 Then
Inc(i)
Else
Dec(i)
End If
End Sub

Main:

' Use PortA <1,0> as the rotary encoder inputs on PIC
TRISA = 3
TRISB = 0

' Init PIC ports as you want, except for PortA <1,0> to 0
PORTA = 0
PORTB = 0

' PortA <1,0> only required
' Read rotary encoder when the PIC is first powered on
TempRead = PORTA
NewRead = TempRead And 3

While (True)

Do

' Init both byte variables for each new reading
OldRead = NewRead
' Now start reading
TempRead = PORTA ' Read the NewRead value to see if changed
NewRead = TempRead And 3
' If not changed, keep reading
Loop Until (NewRead <> OldRead)

' Xor left bit of NewRead and right bit of OldRead
Direction (NewRead.1 Xor OldRead.0)

Wend

End.



Then DDS control of AD9834 like this:

program AD9834

dim hmsb, hlsb, lmsb, llsb as byte

sub procedure ddswrite
TRISC = TRISC and $FD
Spi_Init
ClearBit(PORTC,1) 'Sync low enable write
Spi_Write($F8) 'Setup AD9834 for writing
Spi_Write($00) 'Just padding.......
Spi_Write($33) 'Write High MSB into register $33
Spi_Write(hmsb)
Spi_Write($22) 'Write Low MSB into register $22
Spi_Write(hlsb)
Spi_Write($31) 'Write High LSB into register $31
Spi_Write(lmsb)
Spi_Write($20) 'Write Low LSB into register $20
Spi_Write(llsb)
Spi_Write($C0) 'Enable AD9834 for transmit
Spi_Write($00)' 'Just padding.......
SetBit(PORTC,1) 'Sync high disable write
end sub
main:
' while true

hmsb = 4
hlsb = 0
lmsb = 0
llsb = 0

ddswrite

' wend
end.


Using another routine called Print_Dec_16 which handles all the LCD figure justification and then putting it all together a starting place based on code by kuhng@vodamail.co.za and a couple others, will provide proper references, I get:


program AD9851
' Author M1KTA, dombaines@yahoo.com
' A simple program to enable Rotary Encoder control of an AD9851 DDS
' based on a simple program to enable KeyPad control of an AD9851 DDS
' DDS circuit from www.amqrp.org/kits/dds60
' Generate any frequency up to about 80 MHz, 1Hz steps ! (Specs 60 MHz)
' 16X2 Lcd on Port D, DDS on Port C, KeyPad on Port B
' Default startup values in eeprom, 1 MHz out, for 180 MHz Clock
' Standard Pic 16F877A, EasyPic4 connections apply
' RA0 switches display to frequency entry, RA1 changes clock value
' Both pins are normally pulled high, switches when pulled low
' KeyPad "*" deletes last keypress only, "#" writes new values to eeprom
' Port B KeyPad, pins pulled LOW !

include "Print_Dec_16" ' Xor's lcd print utility
symbol delay50 = Delay_ms(50)
symbol delay500 = Delay_ms(500)
Dim frequency, xtal, cfreq, KeyInput,KeyInputOld as longint
dim Key,Key1, byte_s as byte
dim myvar as string[11]

const KeyPad as byte[16] = (49, 50, 51, 65, 'Map 4*4 KeyPad to ascii
52, 53, 54, 66,
55, 56, 57, 67,
42, 48, 35, 68)

sub procedure Welcome ' Welcome Message
dim I as byte
lcd_cmd(LCD_CURSOR_OFF)
lcd_cmd(lcd_clear)
lcd_out(1, 4, "M1KTA")
lcd_out(2,4,"AD-9851 DDS")
For I = 0 to 3
Delay500
Next I
lcd_cmd(lcd_clear) ' Message Ends
end sub

' Read frequency value stored in eeprom
sub function eread01(dim eeprom_addr, offset as byte) as longint
For offset = 0 to 3
FSR = @ frequency + offset
INDF = EEPROM_READ(eeprom_addr + offset)
Next offset
result = frequency
delay50
end sub

' Read clock value stored in eeprom
sub function eread02(dim eeprom_addr, offset as byte) as longint
For offset = 0 to 3
FSR = @ xtal + offset
INDF = EEPROM_READ(eeprom_addr + offset)
Next offset
result = xtal
delay50
end sub

' Write new frequency to LCD
sub procedure lcdwrite01(dim yy as longint)
Lcd_Cmd(LCD_CLEAR) ' Clear display
Lcd_Cmd(LCD_CURSOR_OFF) ' Cursor off
print_dec(yy,"##.######",RJZ,myvar)
Lcd_Out(1, 4, "M1KTA")
Lcd_Out(2,3,myvar)
Lcd_Out(2,13,"MHz")
delay500
end sub

' LvZ maths, calculate divisor value
sub function CalcFreq(dim f, x as longint) as longint
dim g as float
g = ( f / x ) * $7FFFFFFF
result = longint(g) * 2
delay50
end sub

' Florin Medrea's bit swap routine, forces SPI to TX LSB first
sub function swap_bits(dim data_b as byte) as byte
dim i,j as byte
result = 0
i = 0
j = 7
while i < 8
if TestBit(data_b,i) = 1 then SetBit(result,j) end if
inc(i)
dec(j)
wend
end sub

' Reset and fill DDS data register with zero values
sub procedure ddsclear
ClearBit(PORTC,1)
Soft_Spi_Write($00)
Soft_Spi_Write($00)
Soft_Spi_Write($00)
Soft_Spi_Write($00)
Soft_Spi_Write($00)
SetBit(PortC,1)
end sub

' Write divisor and config values to DDS
sub procedure ddswrite(dim f as longint) ' Soft SPI
eread01(0, 0) ' Read eeprom for Freq
delay50
eread02(16, 0) ' Read eeprom for Clock
delay50
cfreq = CalcFreq(frequency, xtal) ' Calculate divisor
delay50
TRISC = TRISC and $FD
ClearBit(PORTC,1) 'Sync low enable write
byte_s = swap_bits(lo(f)) ' Swap over and write LSB
Soft_Spi_Write(byte_s)
byte_s = swap_bits(hi(f)) ' Swap over and write next byte
Soft_Spi_Write(byte_s)
byte_s = swap_bits(higher(f)) ' Swap over and write next byte
Soft_Spi_Write(byte_s)
byte_s = swap_bits(highest(f)) ' Swap over and write next byte
Soft_Spi_Write(byte_s)
byte_s = swap_bits($01) ' Swap over and write config byte
Soft_Spi_Write(byte_s)
SetBit(PORTC,1) ' Sync high disable write
delay50
lcdwrite01(frequency) ' Write new frequency to LCD
delay50
end sub

' Write Freq value to eeprom
sub procedure ewrite(dim xx as longint)
Eeprom_Write(0, lo(xx))
delay50
Eeprom_Write(1, hi(xx))
delay50
Eeprom_Write(2, higher(xx))
delay50
Eeprom_Write(3, highest(xx))
delay50
end sub

' Write Clock value to eeprom
sub procedure ewrite2(dim xx as longint)
Eeprom_Write(16, lo(xx))
delay50
Eeprom_Write(17, hi(xx))
delay50
Eeprom_Write(18, higher(xx))
delay50
Eeprom_Write(19, highest(xx))
delay50
end sub

'Original routine from Sorcerer, read Freq from keypad
sub Procedure Frequency_Input
Lcd_cmd(lcd_clear)
Lcd_Out(1, 4, "Freq in MHz")
Lcd_Out(2, 3, "Enter with #")
Key1 = 0
KeyInput=0
KeyInputOld=0
While Key1<>35 ' Exit on #
Key=0
while Key = 0
Key = Keypad_Released
Wend
Key1=KeyPad[Key-1]
If Key1=42 Then '* = delete (last input only!)
KeyInput=KeyInputOld
End If
If (Key1>47) and (Key1<58) then '0-9 are added in, anything else ignored
KeyInputOld = KeyInput
KeyInput = KeyInput * 10
KeyInput = KeyInput + Key1 - 48
End If
print_dec(keyinput,"##.######",RJZ,myvar)
Lcd_cmd(LCD_CURSOR_OFF)
Lcd_Out(2, 1," ")
Lcd_Out(2, 4, myvar)
delay50
Wend
ewrite(Keyinput) ' Store frequency value in eeprom
delay50
ddswrite(cfreq) ' Two writes to set registers ???
ddswrite(cfreq)
end sub

' Original routine from Sorcerer, read Clock from KeyPad
' Adjust for different Clock, or Fine Tune
sub Procedure Clock_Input
Lcd_cmd(lcd_clear)
Lcd_Out(1, 1, "Xtal Freq in MHz")
Lcd_Out(2, 3, "Enter with #")
Key1 = 0
KeyInput=0
KeyInputOld=0
While Key1<>35 ' Exit on #
Key=0
while Key = 0
Key = Keypad_Released
Wend
Key1=KeyPad[Key-1]
If Key1=42 Then '* = delete (last input only!)
KeyInput=KeyInputOld
End If
If (Key1>47) and (Key1<58) then '0-9 are added in, anything else ignored
KeyInputOld = KeyInput
KeyInput = KeyInput * 10
KeyInput = KeyInput + Key1 - 48
End If
print_dec(keyinput,"###.######",RJZ,myvar)
Lcd_cmd(LCD_CURSOR_OFF)
Lcd_Out(2, 1," ") ' Cleans Line for next display
Lcd_Out(2, 4, myvar)
delay50
Wend
ewrite2(Keyinput) ' Store clock value in eeprom
delay50
ddswrite(cfreq) ' Two writes to set registers ???
ddswrite(cfreq)
end sub

main:
ADCON1 = 7
trisa = %11111111
trisc = 0
Soft_Spi_Config(PortC,4, 2, 3) ' Required for Soft_SPI
Lcd_Init(PORTD) ' Init LCD on port D
Keypad_Init(PORTB) ' Init KeyPad port B
Welcome ' Display Welcome message
ddsclear ' Write zero values to DDS buffer
ddswrite(cfreq) ' Read stored values, write to DDS
ddswrite(cfreq) ' Two writes to set registers ????
eloop:
if porta.0 = 0 then ' Key for frequency change
Frequency_Input ' Jump to frequency keypad routine
end if
if porta.1 = 0 then ' Key for Clock change
Clock_Input ' Jump to clock keypad routine
end if
goto eloop
end.

Cage Dipole


One end of a Cage Dipole

Thursday, 20 August 2009

PICEL - III


Thought I'd a have a bit of fun and look at the new USB capable PIC EL -III kit from AA0ZZ.
So ordered a kit from Bill at KangaUS

Paraset Build - knobs

Extra update sent a set of three knobs from G3WXI, not the latest run he did but NOS and they look fine... Will fit when re drill the holes as bit small on front panel.

Wednesday, 19 August 2009

M1KTA QRP TCVR HB-1A - KX1 Clone




Ok going to have a bit of fun and rework the design starting off with reworking the pcb layout and will add in what I know works for psk and ssb. Will use Express PCB as a layout as i will create the PCB with Blue press n peel film.

I asked someone who has one to show it on a web cam as I wanted to get some decent images of L7 and L8 and T1, T2 and T3.

L7 and L8 are the output filter and are l7 0.6uH and l8 0.5uH the HB-1A uses little 1cm OD, 0.5cm thick, 0.5cm hole ferrites. l7 is 10T and L8 is 11T of what looks like simple hook up wire.

I probably should not have worried hough... KX1 uses same design and the details using T37 cores are in the docs.

T1 uses the same core and the critical information is that the windings are Primary 7T and Secondary 2T.


T2 and T3 are canned coils


I also have a better idea of the through hole components on the SMT IC side. The PIC is socketed and there are no in circuit programming connections.
IC7 the keyer chip is placed on the reverse.
The 4 sets of 6 holes are the four switches from the front.




Tuesday, 18 August 2009

HB-1A QRP TCVR



Lots of interest being generated for this little tcvr from China. (BD4RG)
I built a PFR-3 and KX1 already (PFR-3 on this blog) and I never considered those to be identical rigs although fulfilling similiar use as /P portable rigs. So I thought I'd have a look at what all the fuss was about as some claiming the HB-1A to be very close to the Kx1, and about 1/2 the price.

A JN1GLB photo of the 'kit' he obtained


JN1GLB photo of the rear of the board.

The KX1 and the HB-1A do share a lot of similarities, but the SA602 and LM386 AF chain is not exactly unique to either. Both do use a AD9834 DDS with 50MHz clock but that again appears in a few places.
The HB-1A using a split 2 PIC design with a main DDS/rig control PIC 16F73 and a separate keyer chip PIC 12F629, the KX1 using the single PIC 16F876A to accomplish both.
The mute in KX1 comes from RA4 / 16F876A the HB-1A uses pin 8 /PIC 12F629 keyer. The KX1 mute circuit one uses a pair of J309 HB-1A uses a single 2N7000 to interrupt the AF. If you are going to mute the RX then you have to switch off the input to the LM386 somehow. However, the HB-1A adds an extra mute after the Lm386 as well and the tone output from the pin 5/ PIC 12F629 feeds to the phones. The KX1 feeds the side tone pitch and level from 16F876A (RA5) .
The HB-1A has a very similar IF filter with 4 common 4.1952 MHz crystals. The KX1 IF being at 4.913MHz. The filter band width is controlled by a rotary pot in KX1 but through the PIC 16F73 in HB-1A.
The HB-1A used SMT components throughout. KX1 through hole.
The HB-1A reports battery voltage and the frequency display is to 5 signifiant figures (10Hz resolution). KX1 to 1kHz resolution.
I find the HB-1A interesting as I have many of the components in the junk box (and in SMT form!) and I have a couple of spare keyer PIC 12F629 and a selection of PIC/AVR AD DDS chips and some Si570, perhaps an alternative homebrew version of this might be a fun project.












Sunday, 16 August 2009

Paraset progress




OK made new panel today and transfered loads over to it, using 6BA bass fixing too.

The dead head caps also started to transfer the attachments from others I have so that the lock nut ones i have used (actually 200pF not 100pF) now work.

Missing the RX dial control, will mill a M12 nut and bolt shortly.

Thursday, 13 August 2009

Even more photos cycling through HB9

Another pretty swiss village. Damned cobbles not nice to cycle on.... rattle ratte rattle...

Plenty of stops for water...

and map reading

The views were amazing, btw this is a road in the middle of the day, busy hey!

HB0 operating, note the high gain antenna!

Another view of the campsite, the washing line is the W3EDP antenna!

The swiss park caravans under these little garage things so can use them in winter when lots of snow.

More of Cycle trip across HB9, stopping in HB0 (2007)

HB0 castle on edge of country.

Now this is a nice cycle lane!

Got to do some more of that radio stuff... NB the solar panel in the sun on front pannier!

XYL

It was 30 degrees!

Rush hour!

Winter barns... all empty at this time of year.

Lake side camping.

Lucern

Lucern

Yes it does rain in HB9

There was nothing on the cycle path 10 minutes before this.

Got to the top of a steep hill climb.... had to do at least one cycling in HB9

And dragged the derallieur across into rear wheel... bending post!

So quickly took train back to Zurich. Now this is how travelling by train and bicycle should be done in UK IMHO!

Whilst bike being fixed walk up hill over looking Zurich.

Dunno why took these photos!

We got that far!