1 / 15

OARC Microcontroller Club Project 2009 Picaxe PIC16F886

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

toshi
Download Presentation

OARC Microcontroller Club Project 2009 Picaxe PIC16F886

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OARC Microcontroller Club Project 2009PicaxePIC16F886 David Conn VE3KL

  2. PIC Project C ProgrammingPIC16F887 Develpoment Board Programmer PC Transmitter Dummy Load/Power Meter David Conn VE3KL

  3. Using Picaxe EEPROM256 Bytes • Used with the Keyboard • Used with the Power Meter • EEPROM stores data that can be retrieved 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 EEPROM read 0,b1 put 66 into variable b1 read 5,b2 puts “V” into variable b2 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! David Conn VE3KL

  6. EEPROM Practice Files • eeprom_simple_test.bas • eeprom_simple_test1.bas 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 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) David Conn VE3KL

  8. Keyboard & EEPROM Practice Files • keyboardscancode.bas • keyineepromtable.bas David Conn VE3KL

  9. Power Meter VE3KL 16 Watt Dummy Load/Power Meter Elecraft DL1 minimodule 20 Watt Dummy Load/Power Meter Elecraft David Conn VE3KL

  10. Power Meter Block Diagram Picaxe Analog Input EEPROM Dummy Load Detector 0 to 5 Volts DC Transmitter CW 10 Watts 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 I2C Display David Conn VE3KL

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

  12. 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 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 Conn VE3KL

  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

More Related