Saturday, June 28, 2014

BUJJI BUG


Picture of BUJJI BUG.


Friday, June 27, 2014

BUJJI BUG PART 3

Here we are generating DIT.
The KEY OUT is sent HIGH and LOW with a delay of 250 msec when theKEY IN is grounded,
KEY OUT is sent LOW when the KEY IN is HIGH.
To check the OUTPUT we connected LED to the GP1 (pin no 6 of IC).

For circuit see part 1.


; BUJJI BUG
; CODE FOR DIT generation.
list p = 12F683 ; Selected 12F683
#include<p12F683.inc> ; Includeing the headerfile
; In this program we are generating DIT
; here GPIO 5 (pin no. 2) is pulled to HIGH by the resistor
; external paddle is connected to this pin,
; when it is pulled-down/grounded (pin no.2) The KEY OUT GPIO 1 is send to HIGH (5 volts)
; and LOW (0 V) with a delay of 250 msec. It will continue till the paddle is released.
; Otherwise KEY OUT will be in the LOW state(0 volts).
; To verify we connect an LED from pin  no 6 with a resistor 2K7.
;..............................................
; Till now we have not used any RAM which is also called GENERAL PURPOSE REGISTER
; in microprocessor/microcontroller world
CBLOCK 0X30 ; Starting Address/location of the registers
COUNT1 ; Location 0X30 is referred as COUNT1 in the                                                                                                                                        ; program
COUNT2 ; Location 0X31 is referred as COUNT2 in the                                                                                                                                ; program
ENDC ; end the block
;..............................................
ORG 0X00 ; Starting address for microcontroller program
CLRW ; Clearing the W register
CLRF COUNT1 ; Clearing the COUNT1 register at power ON time
CLRF COUNT2 ; Clearing the COUNT2 register at power ON time
NOP ; NO operation
NOP ; This location is reserved for INTERRUPT and
; hence we always code the fifth line as NOP
; Initialising the INPUT and OUTPUT PORTS

BSF STATUS,RP0 ; Selecting the bank 1
BSF OSCCON,IRCF0 ; Internal Oscillator frequency can be configured by
BCF OSCCON,IRCF1 ; enabling the appropriate registers in the OSCCON                                                                                                                                ; register
BSF OSCCON,IRCF2 ; IRCF0, IRCF1,IRCF2 are the bits to select the                                                                                          
                                                                                 ; various frequency ranges here we have configured
; 2MHz clock speed to reduce power consumption
BCF STATUS,RP0 ; changing to bank 0
CLRF GPIO ; Clearing the INPUT OUTPUT port registers
MOVLW 0X07 ; Moving the "7(HEX)" into the W register
MOVWF CMCON0 ; Comparators are disabled
BSF STATUS,RP0 ; Changing to bank 1, because the ANSEL,TRISIO,                                                                                                                                         ;,T2CON are in bank 1
CLRF ANSEL ; please see BUJJI BUG part 1
MOVLW 0X38 ; moving "38(HEX)" value into W register
MOVWF TRISIO ; making the GP3,GP4,GP5(pin no 5 of IC)as a input
; and GP0,GP1(pin no 6 of IC),GP2,OUTPUTS
BCF STATUS,RP0 ; Changing to bank 0
GOTO begin ; Goto begin
pause MOVLW 0XFF ; move "FF(HEX)" value into the W register
MOVWF COUNT1 ; presetting COUNT1 register with the value of W register
MOVLW 0X80 ; move the "80(HEX)" value int the W register
MOVWF COUNT2 ; presetting COUNT2 register with the value of W                                                                                                                                         ; register
wait                  DECFSZ COUNT1,F ; Decrement and check whether count1 register is zero,                                                                                                                          ; if zero skip next instruction
GOTO wait ;  otherwise go to wait
DECFSZ COUNT2,F ; Decrement and check whether count2 register is zero,                                                                                                                          ; if zero skip next instruction
GOTO wait ; go to wait
RETURN ; going back to the program code
; every CALL function should end with RETURN
;....................................
ditON BSF GPIO,1 ; when input is low(0 V)make the GPIO pin no 1 as                                                                                                                                  ; high(LED IS ON)
CALL pause ; Call delay
BCF GPIO,1 ; Clearing the GP1 pin (0 V) (LED is OFF)
CALL pause ; Call delay
GOTO check ; goto run to check the condition and repeat the loop                                                                                                                                         ; forever

ditOFF BCF GPIO,1 ; when the input is high(5 V) make the GPIO pin no 1                                                                                                                                ; as LOW(LED iS OFF)
GOTO check ; goto run to check the condition and repeat the loop

begin                NOP
check BTFSS GPIO,5 ; checking the input status of the GP5( pin no 2 of IC)
GOTO ditON ; if it is Clear(ZERO) goto dashON otherwise
GOTO ditOFF ; goto dash
END ; end of the program



; NOTE 1: This program is running with 2MHZ clock
; NOTE 2: program memory will begin from the address 0X00
; NOTE 3: we can configure the internal clock to work at various frequencies
; OSCCON register is used to select the frequencies
; NOTE 4: ANSEL Register is used to select the analog I/O.
; By clearing it we are making all pins as DIGITAL IO ports
; NOTE 5: we are not using any comparators in our program
; so we are disabling them by passing the value "7" into CMCON0
; NOTE 6: one instruction cycle consists of 4 oscillations, to execute one instruction
; it wil take 2 usec since clock is 2MHz
; DECFSZ and GOTO instruction will take 2 instruction cycle each
; 255usec* 4 = 2 mses
; repeating the loop for 128 times => 256 msec of delay.


Here is the HEX code;

:020000040000FA
:100000000301B001B101000083160F168F120F1704
:10001000831285010730990083169F0138308500CF
:1000200083122228FF30B0008030B100B00B1628B8
:10003000B10B1628080085141220851012202328E1
:0C004000851023280000851E1B282028A6
:00000001FF

Thursday, June 26, 2014

BUJJI BUG PART 2


Here we are generating DASH along with side tone  @650 Hz.
To our OLD program we are adding few lines to generate the tone.
AUDIO Amplifer LM386 is included in the circuit to listen the tone in 8 Ohms speaker.
The circuit diagram is given below:

Circuit Diagram

CODE for DASH generation along with side-tone

; BUJJI BUG
;CODE FOR DASH generation along with sidetone
                       list p = 12F683 ; Selected 12F683
                       #include<p12F683.inc> ; Including the headerfile
; We are adding only 10 lines to our OLD program
; Whenever the paddle key GP5 (pin no 2) is pulled-down/connected to the ground,
; The KEY OUT GPIO 1 is sent HIGH and a side tone of 1 KHz @ GP2 (pin no 5)
; otherwise the paddle key is pulled HIGH through a resistor and also send
; KEY OUT to LOW (0 V) @GP1(pin no 6), No sidetone is generated.
;..............................................
                       ORG 0X00 ; Starting address for microcontroller
                       CLRW ; Clearing the W register
                       NOP ; NO operation
                       NOP ; NO operation
                       NOP ; NO operation
                       NOP ; NO operation
                       GOTO           START ; goto start
; Initialising the INPUT and OUTPUT PORTS
START  BSF STATUS,RP0 ; Selecting the bank 1 BSF OSCCON,IRCF0 ; Internal Oscillator frequency can be configured by BCF OSCCON,IRCF1 ; enabling the appropriate registers in the OSCCON
; register BSF OSCCON,IRCF2 ; IRCF0, IRCF1,IRCF2 are the bits to select the 
; various frequency ranges
BCF STATUS,RP0 ; changing to bank 0 
                       CLRF           GPIO ; Clearing the INPUT OUTPUT port registers
                       MOVLW     0X07 ; Moving the "7(HEX)" into the W register
                       MOVWF     CMCON0 ; Comparators are disabled by passing the                                                                                                                                 ; "7" into the COMCON0 register
                       BSF             STATUS,RP0 ; Changing to bank 1, because the ANSEL                                                                                                                                 ; TRISIO,T2CON are in bank 1
                       CLRF           ANSEL ; Making the INPUT & OUTPUT as digital by                                                                                                                               ; clearing the ANSEL register                              
                       MOVLW     0X38 ; moving "38" value into W register
                       MOVWF     TRISIO ; making the GP3,GP4,GP5(pin no 5 of IC)as a input and                                                                                                             ;GP0,GP1(pin no 6 of IC) ,GP2
                                                                      ; OUTPUT by passing the value to TRISIO register
;Initialising the PWM for Sidetone
; Below 8 lines are added extra to OUR OLD PROGRAM
                       MOVLW     0XC0 ; Writing the value "CO(HEX)" into the W register
                       MOVWF     PR2 ; passing the value into PR2 register.
                       BCF           STATUS,RP0 ; bank zero is selected
                       BSF           T2CON,T2CKPS0 ; TIMER2 prescalar value is initiaizing as 1:4 ratio                                                                                                                     ; by setting T2CKPS0 bit
                       BCF           T2CON,T2CKPS1  ; and clearing the T2CKPS1 bit in the T2CON register
                       BCF           T2CON,TMR2ON ; Enabling the TIMER2 by setting the bit TMR2ON
                       MOVLW     0X0C ; Writing the value "12" into the W register
                       MOVWF     CCP1CON             ; Configuring the GP3 (pin no 5) as PWM OUTPUT      
                       GOTO           begin                     ; Goto begin
;....................................
dashON         BSF      GPIO,1 ; when input is low(ZERO)make the GPIO pin no                                                                                                                       ;1 as high(LED IS ON)
; TWO more lines are added here to switch ON the PWM.
;.....................................................
                       MOVLW     0X62
                       MOVWF     CCPR1L ; PWM will be 50% by passing the value "62(HEX)" into the CCPR1L register.
;...................................................
                       GOTO          run ; goto run & check the condition and repeat the loop ever
dashOFF BCF            GPIO,1 ; when the input is high make the GPIO pin no 1                                                                                                                         ;as LOW(LED iS OFF)
; one more line is added here to SWITCH OFF the PWM.
;....................................................
                       CLRF          CCPR1L ; PWM will become ZERO by passing the value                                    
                       GOTO         run ; goto run to check the condition and repeat the loop                                                                                                                   ; "0" to the CCPR1L register
;...................................................
; This is the OLD CODE only
begin NOP ; NO operation
run BTFSS         GPIO,5 ; checking the input status of the GP5( pin no 2 of IC)
                       GOTO         dashON                 ; if it is Clear(ZERO) goto dashON otherwise
                       GOTO         dashOFF ; goto dash
                       END ; end of the program




; NOTE 1: This program is running with internal 2MHZ clock
; Note 2; We are using 4 NOP (No OPeration) instructions after the ORG 0X00 avoiding the risk of interrupts
; NOTE 3: program memory will begin from the address 0X00
; NOTE 4: we can configure the internal clock to work at various frequencies
; OSCCON register is used to select the frequencies
; NOTE 5: ANSEL Register is used to select the analog I/O.
; By clearing it we are making all pins as DIGITAL IO ports
; NOTE 6: we are not using any comparators in our program
; so we are disabling them by passing the value "7" into CMCON0
; NOTE 7: Three register are required to enable the PWM in 12F683
; 1. TMR2 is used to prescale the Fosc. here we are pre scalling it to 1:4 ratio
; 2. PR2 is used to select the period of the PWM
; PR2 = PWM period/(4*Tosc* TMR2prescalar)-1
; 3. CCPR1L register is used to assign the duty cycle of PWM
; we are using 8 bit PWM => 62(HEX) is passing into the register to get 50% PWM.
; So PWM is ON.
; To switch OFF PWM we assign duty cycle 0% by resetting CCPR1L.

Here is the HEX code

:020000040000FA
:100000000301000000000000000006288501073001
:10001000990083169F0138308500831213288514B8
:0E0020001428851014280000851E0F281128B2
:00000001FF

Wednesday, June 25, 2014

LET US CODE BUJJI BUG PART 1.

Let us start learning to code BUJJI BUG.
Let us start with a simple program to generate a DASH or DAH.
We are using 12F683 as this is small footprint IC only 8 pins
Please see the circuit diagram and picture as given below:

Circuit Diagram
Picture


Here is the code:

; BUJJI BUG
; CODE FOR DASH generation
list p = 12F683 ; Selected 12f683
  #include <P12F683.inc> ; Including the headerfile
; In this program we are generating DAH(DASH)
; here GPIO 5 (pin no. 2) is pulled to HIGH by the resistor
; external paddle is connected to this pin,
; when it is pulled-down/grounded (pin no.2) The KEY OUT GPIO 1 is send to HIGH (5 volts).
; otherwise KEY OUT will be in the LOW state(0 volts).
; To verify we connect an LED from pin  no 6 with a resistor 2K7.
;........................................................................................
  ORG 0X00                                     ; Stating address for microcontroller
  CLRW                                  ; Clearing the W register.
  NOP          ; NO operation
  NOP                                   ; NO operation
  NOP                          ; NO operation
NOP                                    ; NO operation
  goto   START ; starting the program
         START CLRF GPIO ; Clearing the INPUT OUTPUT Port register
  MOVLW 0x07 ; Moving the "7" into the W register
  MOVWF CMCON0       ; Disabling the comparators by passing "7" in the CMCON0                                                                                                                               ; register

  BSF STATUS,RP0 ; Changing to bank 1, because ANSEl is in Bank 1
  CLRF ANSEL ; Initialising the IO ports as a Digital by clearing the ANSEL                                                                                                                             ; register
  MOVLW 0x38 ; Moving "38" into the W register
  MOVWF TRISIO ; Making the GP3,GP4,GP5(pin no 2 of IC) as INPUT and
NOP                                     ; GP0,GP1(pin no 6 of IC),GP2 OUTPUTS by passing the                                                                                                                            ; value into TRISIO register
BCF STATUS,RP0 ; We have to come back to bank 0 then only program will                                                                                                                              ; run.
goto                 begin               ; Goto begin
;...........................................................................................
        dashON BSF GPIO,1            ; When the input is LOW(ZERO) make the GPIO pin 1 as                                                                                                                              ; HIGH (LED IS ON)
goto run ; goto Run to check the condition and repeat the loop for                                                                                                                                 ; ever

        dashOFF BCF GPIO,1 ; When the input is HIGH make the GPIO pin 1 as LOW                                                                                                                               ; LED is OFF)
goto                 run ; goto run to check the condition and repeat the loop
;............................................................................................
       begin NOP
        run BTFSS GPIO,5 ; Checking the Input status of the GP5 (PIN no 2 of IC)
goto dashON ; If it is Clear(ZERO) goto dashON otherwise
goto dashOFF ; goto DashOFF
end ; End of the program

Here is the HEX code:

:020000040000FA
:100000000301000000000000000006288501073001
:10001000990083169F0138308500831213288514B8
:0E0020001428851014280000851E0F281128B2
:00000001FF


Happy homebrewing!

Wednesday, June 18, 2014

BUJJI BUG

We have selected Bujji Micro12F683 for the Bujji BUG project.

This Bujji Micro has got only 8 pins just like 555 timer.

Please see the photo to see how small this 12F683 is compared to 16F628A/16F84.



PIC12F683 has following feature:
  • nano Watt Technology
  • 4 channel, 10 bit ADC.
  • 2X8 bit and 1X16 bit timer.
  • 1  PWM
  • EEPROM 256 bytes.
  • 2K flash.
Full data is available in microchip website www.microchip.com


Tuesday, June 17, 2014

PRODUCTS FOR THIS YEAR FOR SWLs STUDENTS

Dear all,

Products for this year for SWLs, STUDENTS etc.,


BUJJI YAMP

Good Morning,

Here we comes with BUJJI YAMP. It is assembled with only six components for each amplifier. 1 LM386,  2 Resistors and 4 Capacitors.

The amplifier circuit is taken from the data sheet of  LM386 with a gain of 20. The normal mobile charger or PC/LAPTOP USB can be used to power up the device. The audio is feed through stereo cable into the pin no 3 of LM386. It is meant to listen the music through your phone hands free.


Saturday, June 7, 2014

Designing of Single section Band Pass Filter

Dear all,

Today we present a simple method for designing a single section band pass filter.

The Impedance of the coil is 75 Ohms = 2πFL
Impedance of capacitance = 1/2πFC

Let us calculate value of  L & C for F of 17.820 MHz and R = 75 Ohms.

Capacitance value calculation:
                                                                           R = 1/2πFC

Where                  F = 17.820 MHz
                            R = 75 Ω
                                                                           C = 1/2πRF
                                                                           C = 120 pF

Inductor Value calculation :
                                                                           R = 2πFL
Where                  F = 17.820 MHz
                            R = 75 Ω
                                                                           L = R/2πF
                                                                           L = (75)/(2*π*17.82*10^6)
                                                                           L = 0.7µH



Approx Expected Q of the copper coil is between  200 and 300.

Bandwidth of the circuit is                              = F/Q

Loaded Q is decided as 20 to take care of low insertion loss.

The loaded Q is around 20      =>           Bandwidth is 891 KHz

Impedance of the coil is 75 Ω

For Q = 20 the impedance of the tank circuit is 75 * 20 = 1500 Ω

Loaded Q is 20

Rin = Rout = 50Ω ( input impedance is 50 Ohms )

Equivalent circuit with double loading.

Equivalent circuit with double loaded
 Impedance of the coil is 75 Ω
For Q = 20 the impedance of the tank circuit is 75 * 20 = 1500 Ω
(Here we are neglecting the coil's finite Q)

Series and parallel equivalent of loading circuit

Series and parallel equivalent of loading circuit


parallel to series and series to parallel conversion
Parallel to series and series to parallel impedance conversion equations.

Rp = Rs{1+ (Xs/Rs)^2}
Xp = (Rp*Rs)/Xs          
Rs = Rp/{1+(Rp/Xp)}  
Xs = (Rs*Rp)/Xp         

These equation are from MOTOROLA application note

Now let us calculate Xp and Xs, we know Rp = 1500 and Rs = 25 Ohms
      
Rp = Rs{1+K^2}        
              Where K = Xs/Rs
1 + K^2 = Rp/Rs                           
1 + K^2 = 1500/25                        
1 + k^2 =  60                               
K = 7.6                      

Xs/Rs =  7.5                              
Xs = 7/5 * Rs                    
Xs = 190                           
                      
Xs = 1/2πFC                      
 C = 1/2πXsF                    
       Where  F  = 17.820 MHz
                  Xs = 190
C = 47pF                        

Series equivalent circuit:

Series equivalent circuit
Input/output circuit:

Input/Output circuit

                                                 Xs = Rs*Rp/Xp
                                                 Xp = Rs*Rp/Xs

Where Rs = 25
           Rp = 1500
                                                 Xp = 197

This means for loaded Q of 20 and above Xs and Xp are almost same
Now tuning capacitance Ct = Total capacitance required – coupling capacitor (Xp)
                                                   = 120 – 47 pF
                                                  = 73 pF
Final circuit is 

Final Circuit
      The insertion loss of the circuit is 20Log(D/D-1)

            Where  D = Unloaded Q/desired Q

In our case unloaded Q in between 200 - 300 and the loaded Q is 20.
In our case insertion loss is 1db

There is no circuit which will give zero loss due to finite unloaded Q

If somebody claims he has designed a zero loss band pass filter  then Prof A.ZVEREV Russian scientist would be unhappy man. As he is the designer of insertion loss equation.

Thursday, June 5, 2014

IF SDR

Dear all,

Here we comes with shortwave radio with IF 1.8432 MHz with a few modifications in the SDR circuit.

IF SDR

Crystal Frequency, which we changed from 28.224 MHz to 7.3728 MHz.


Band pass Filter, where the capacitor and inductor  values are changed. The modified and original circuit is shown below.

Modified Band pass Filter
Original Band pass filter


Monday, June 2, 2014

BUJJI YAMP PROTOTYPE

Good Morning,

Here we comes with new Bujji product calling BUJJI YAMP with LM386.