PHP1 V4.0 This version of the display/stabiliser program is for the PIC16F84 or PIC16C84 microcontroller using a 4.000MHz crystal. My transceiver has an I.F. frequency of 7.8000MHz. The required offsets are 7.79850MHz and 7.80150MHz for USB and LSB. gadget40.asm is the source code for the current version of the program used in both of my home made SSB transceivers. The VFO/LO frequency is stored as a 24 bit binary number in registers L_BYTE, M_BYTE and H_BYTE. In this version of the program, the IF offset is stored in registers COUNT1, COUNT2 and COUNT3. (Note that COUNT1/2/3 are also used by other parts of the program). To change the I.F. offset to a different value, locate the label CONVERT in the source code . The code following this label adds/subtracts the I.F. offset to/from the VFO frequency. For example: ADD_HI MOVLW 0X76 ;STORE I.F. OFFSET. MOVWF COUNT1 ;0BE776 HEX = 780150 Dec MOVLW 0XE7 ;THIS IS THE BIT YOU NEED TO MODIFY - MOVWF COUNT2 ;FOR A DIFFERENT IF OFFSET. MOVLW 0X0B MOVWF COUNT3 MOVF COUNT1,W ;ADD I.F. OFFSET TO FREQUENCY ADDWF L_BYTE,F MOVF COUNT2,W BTFSC STATUS,CARRY INCFSZ COUNT2,W ADDWF M_BYTE,F MOVF COUNT3,W BTFSC STATUS,CARRY INCFSZ COUNT3,W ADDWF H_BYTE,F adds 780150 to the VFO frequency. 780150 decimal = 0BE776 hexadecimal. Note that the least significant byte is added first and the most significant byte is added last. To save writing additional code for subtracting, the I.F. is subtracted by using a well know programmers trick. The subtraction is achieved by adding the 2's compliment of the I.F. Adding -780150 to a number has the same effect as subtracting +780150. For example: SUB_HI MOVLW 0X8A ;STORE I.F. OFFSET. MOVWF COUNT1 ;-780150 = 0XF4188A MOVLW 0X18 ;THIS IS THE BIT YOU NEED TO MODIFY - MOVWF COUNT2 ;FOR A DIFFERENT IF OFFSET. MOVLW 0XF4 MOVWF COUNT3 MOVF COUNT1,W ;SUBTRACT I.F. FROM FREQUENCY ADDWF L_BYTE,F MOVF COUNT2,W BTFSC STATUS,CARRY INCFSZ COUNT2,W ADDWF M_BYTE,F MOVF COUNT3,W BTFSC STATUS,CARRY INCFSZ COUNT3,W ADDWF H_BYTE,F Subtracts 779850 from the VFO freq. by adding -779850 to the VFO freq. -779850 = F419B6. I use a scientific calculator to do the decimal to hex conversion. When my trusty Sharp calculator gets lost under the junk pile, I use kCalc, a nice scientific calculator for the KDE desktop. If you haven't yet made the change to Linux, you can use the Windows calculator. This version of the program can subtract the IF from the VFO freq. or add the IF to the VFO freq. I don't have any need to subtract the VFO frequency from the IF. If you need to do this, it should be a fairly trivial programming exercise. I know of at least one radio amateur who made this modification. He has a 40M CW rig with a 12MHz I.F. 12 - 4.95 = 7.05 ASSEMBLING THE PROGRAM. I tried assembling gadget40.asm on several different assemblers. Gpasm for Linux assembles the file without any errors or warnings. Mpasm for Dos or Windows assembles the file without any errors or warnings. I had to make a few changes to the source code before I could assemble it with Picalc for Dos.