![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced Member | This program is designed to set the VDD calibration data (it's erased when you name the Junebug with the PICkit2 software) A calibrated Junebug can program 3.3V PICs that have 5V tolerant I/O like the 18F67J60 (target must have its own 3.3V power supply) You use the Junebugs bootloader feature to install the hex file this program creates (hold down the button near pin1 on the 18F2550) before plugging in the USB cable. After it runs (about 2 sec) unplug the Junebug, close PICkit2 2.50 and hold down the bootloader button and plug in the USB cable. Reload PICkit2 2.50 and install the PICkit2 OS. This program is in testing at this point, do not change anything unless you understand how the PICkit2 bootloader function. Code: ; Change only the data in the two following defines
#define MyJune "Super Junebug" ; Junebug name <= 15 bytes
#define VCal 0xFA81 ; 4.2V Calibration 0x02
list p=18F2550
include <p18F2550.inc>
org 0x2000 ; Junebug bootloader vector
Start clrf INTCON ; interrupts OFF
movlw low(Name)
movwf TBLPTRL
movlw high(Name)
movwf TBLPTRH ; point to Name table
movlw 0xF0 ; EEPROM Name address
movwf EEADR
clrf EECON1
movlw '#' ;
rcall WriteEE
Loop tblrd*+ ; read table and increment
movf EEADR,W
bz WR_VCal
movf TABLAT,W ; W = TABLAT
rcall WriteEE
bra Loop
WR_VCal clrf EEADR ; 0x00 0101FA81
movlw 0x01
rcall WriteEE
movlw 0x01
rcall WriteEE
movlw high(VCal)
rcall WriteEE
movlw low(VCal)
rcall WriteEE
bcf TRISC,0 ; busy LED
Flash clrwdt
decfsz WREG
bra $-2
btg LATC,0 ; flash busy LED
bra Flash ;
Name data MyJune
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;padding
; enter W = Data, will auto increment EEADR
WriteEE bcf PIR2,EEIF ; clear EE flag
clrwdt
movwf EEDATA ; EEDATA = W
bsf EECON1,WREN ; enable EEPROM writes
movlw 0x55
movwf EECON2
movlw 0xAA
movwf EECON2
bsf EECON1,WR
nop
btfss PIR2,EEIF
bra $-2
bcf EECON1,WREN
incf EEADR
return
END |
| | |
| | (permalink) |
| Experienced Member | So that's it? Just fix the software and it'll program 3.3V PICs? With no extra diodes or circuitry? Excellent!
__________________ ========================= Futz's Microcontrollers & Robotics ========================= |
| | |
| | (permalink) | |
| Experienced Member | Quote:
| |
| | |
| | (permalink) |
| Experienced Member | I posted the diode schematic on the Microchip forums, I was told the diodes are unnessary on the 5V tolerent inputs on many 3.3V PICs. I'll consult the datasheets to see which 3.3V PICs have PGD & PGC 5V ratings. The reason you can't calibrate the Junebug is it doesn't have a programmable VDD generator, but once it's calibrated It'll sense your targets VDD. I'll put this into JPUG issue 2, I'd like to figure out the formula for calibration (The PICkit2 puts out 4.2V on VDD and you're asked to measure it) My USB is 5.03V and the result was 0xFA81 for a calibrated PICkit2. Last edited by blueroomelectronics; 7th May 2008 at 01:30 PM. |
| | |
| | (permalink) |
| Experienced Member | Well here's the deal, most 3.3V PICs have 5V tolerent inputs on digital only I/O pins... (always check the datasheet) The 18F67J60 PGC & PGD are on digital pins so no clamp diodes are needed, the 24F the PGC & PGD are on analog inputs so you do need the diodes. 1N5817 work fine. |
| | |
| | (permalink) |
| New Member | isn't it that hard to add a DS4303 chip |
| | |
| | (permalink) |
| New Member | i mean a DS4305 |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Junebug to program Microchip boards? | parts-man73 | Micro Controllers | 7 | 18th May 2008 03:42 AM |
| Question about Inchworm+ | Quan | Micro Controllers | 54 | 28th October 2007 12:20 AM |
| Please help!! program not working | vinke | Micro Controllers | 3 | 5th October 2007 04:58 AM |
| First Program in assembly, And Programmer Inchworm. | Ayne | Micro Controllers | 10 | 9th March 2007 07:26 PM |
| PicBasic Keypad program | Sora | Micro Controllers | 0 | 20th April 2004 07:01 PM |