OARC Microcontroller Club Project 2009 Picaxe PIC16F886

15
06/14/22 David Conn VE3KL 1 OARC Microcontroller Club Project 2009 Picaxe PIC16F886

description

OARC Microcontroller Club Project 2009 Picaxe PIC16F886. PIC Project C Programming PIC16F887. Develpoment Board. Programmer. PC. Transmitter. Dummy Load/Power Meter. Using Picaxe EEPROM 256 Bytes. Used with the Keyboard Used with the Power Meter - PowerPoint PPT Presentation

Transcript of OARC Microcontroller Club Project 2009 Picaxe PIC16F886

Page 1: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 1

OARC Microcontroller Club Project 2009Picaxe

PIC16F886

David
Page 2: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 2

PIC Project C ProgrammingPIC16F887

Develpoment Board Programmer

Dummy Load/Power Meter

Transmitter

PC

Page 3: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 3

Using Picaxe EEPROM 256 Bytes

►Used with the Keyboard►Used with the Power Meter

►EEPROM stores data that can be retrieved

Page 4: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 4

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 EEPROMread 0,b1 put 66 into variable b1read 5,b2 puts “V” into variable b2

Page 5: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 5

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!

Page 6: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 6

EEPROM Practice Files

► eeprom_simple_test.bas► eeprom_simple_test1.bas

Page 7: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 7

EEPROM with Keyboard

Example: the scan code for the Key “A” is $1C

main:Kbin [1000,main], b1 ;get scan code. Put into variable b1read b1,b2 ;read from the EEPROMdebuggoto 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)

Page 8: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 8

Keyboard & EEPROM Practice Files

► keyboardscancode.bas► keyineepromtable.bas

Page 9: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 9

Power Meter

Elecraft DL1 minimodule 20 Watt Dummy Load/Power MeterElecraft

VE3KL 16 Watt Dummy Load/Power Meter

Page 10: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 10

Power Meter Block Diagram

TransmitterCW 10 Watts

DummyLoadDetector

Picaxe

AnalogInput

EEPROM

0 to 5 Volts DC

I2C DisplayDiode Detector . Detects RF from TXDC fed to ADC of Picaxe (0 to 255)Picaxe looks up power level from EEPROMPower out displayed in Watts

EEPROM values calculated from a formula

David
Page 11: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 11

Power Meter Circuit10 Watts Max

RPicaxe

AnalogInput(Pin 19)

EEPROM

I2C DisplayR CRF Input

R=25 Ohms C=0.01 uF D1: 1N5711 D2: 1N914 R1 20K R2 10 K

R2

R1

+5 VoltsD1

D2

David
Page 12: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 12

The Formula

Pin = (10/255^2)*bo^2

bo is the A/D variable read in to the PicaxeThis formula is written into the EEPROMSee the program supplied

David
Page 13: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

04/21/23 David Conn VE3KL 13

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

David
Page 14: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

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.

Page 15: OARC Microcontroller Club Project 2009 Picaxe PIC16F886

73 Dave VE3KL

• Work lots of DX

• Build stuff

• Attend flea markets and hope for a following wind