Presentation is loading. Please wait.

Presentation is loading. Please wait.

11/29/2015David Conn VE3KL1 OARC Microcontroller Club Project 2009 Picaxe PIC16F886.

Similar presentations


Presentation on theme: "11/29/2015David Conn VE3KL1 OARC Microcontroller Club Project 2009 Picaxe PIC16F886."— Presentation transcript:

1 11/29/2015David Conn VE3KL1 OARC Microcontroller Club Project 2009 Picaxe PIC16F886

2 11/29/2015David Conn VE3KL2 PIC Project C Programming PIC16F887 Develpoment Board Programmer Dummy Load/Power Meter Transmitter PC

3 11/29/2015David Conn VE3KL3 Using Picaxe EEPROM 256 Bytes ►Used with the Keyboard ►Used with the Power Meter ►EEPROM stores data that can be retrieved

4 11/29/2015David Conn VE3KL4 EEPROM 256 Bytes in Picaxe Put data in EEPROM with the command: EEPROM location,(data,data...) Example: EEPROM 0,(66,12,0,0,0,”V”) means The number 66 is stored in location 0 of the EEPROM 12 is stored in location 1 zero's stored in locations 2,3,4 Ascii “V” is stored in location 5 ------------------------------------------------------------------- ;Read from EEPROM read 0,b1 put 66 into variable b1 read 5,b2 puts “V” into variable b2

5 11/29/2015David Conn VE3KL5 The Normal way to use EEPROM (Write 16 lines by 16 Bytes) EEPROM $00,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $10,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $20,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $30,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $40,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $50,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $60,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $70,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $80,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $90,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $A0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $B0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $C0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $D0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $E0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $F0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) ; In the above, all the data is zero ; the location is written in Hex ; Note that $10 corresponds to decimal 16 … 16 numbers per line!

6 11/29/2015David Conn VE3KL6 EEPROM Practice Files ► eeprom_simple_test.bas ► eeprom_simple_test1.bas

7 11/29/2015David Conn VE3KL7 EEPROM with Keyboard Example: the scan code for the Key “A” is $1C main: Kbin [1000,main], b1;get scan code. Put into variable b1 read b1,b2;read from the EEPROM debug goto main ; All data set to zero except the “A” at location $1C EEPROM $00,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $10,(0,0,0,0,0,0,0,0,0,0,0,0,”A”,0,0,0) EEPROM $20,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $30,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $40,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $50,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $60,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $70,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $80,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $90,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $A0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $B0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $C0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $D0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $E0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) EEPROM $F0,(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

8 11/29/2015David Conn VE3KL8 Keyboard & EEPROM Practice Files ► keyboardscancode.bas ► keyineepromtable.bas

9 11/29/2015David Conn VE3KL9 Power Meter Elecraft DL1 minimodule 20 Watt Dummy Load/Power Meter Elecraft VE3KL 16 Watt Dummy Load/Power Meter

10 11/29/2015David Conn VE3KL10 Power Meter Block Diagram Transmitter CW 10 Watts Dummy Load Detector Picaxe Analog Input EEPROM 0 to 5 Volts DC I2C Display Diode Detector. Detects RF from TX DC fed to ADC of Picaxe (0 to 255) Picaxe looks up power level from EEPROM Power out displayed in Watts EEPROM values calculated from a formula

11 11/29/2015David Conn VE3KL11 Power Meter Circuit 10 Watts Max R Picaxe Analog Input (Pin 19) EEPROM I2C Display R C RF Input R=25 Ohms C=0.01 uF D1: 1N5711 D2: 1N914 R1 20K R2 10 K R2 R1 +5 Volts D1 D2

12 11/29/2015David Conn VE3KL12 The Formula Pin = (10/255^2)*bo^2 bo is the A/D variable read in to the Picaxe This formula is written into the EEPROM See the program supplied

13 11/29/2015David Conn VE3KL13 Program Flow PowerMeter_template.bas ; program flow ; set up i2c slave for display ; adc into b0 ; read power from EEPROM ; use bintoascii to separate the power numbers ; write to the display ; loop

14 Power Meter Calibration Adjust R2 to give proper reading compared to a power meter standard Do this for several frequencies up to 500 MHz Put correction factor in program Use simple keypad to select the band of operation.

15 73 Dave VE3KL Work lots of DX Build stuff Attend flea markets and hope for a following wind


Download ppt "11/29/2015David Conn VE3KL1 OARC Microcontroller Club Project 2009 Picaxe PIC16F886."

Similar presentations


Ads by Google