Maybe have the PC write to an EEPROM. Then at Pic boot time the EEPROM is read for a set of pre difined parameters ....
Maybe have the PC write to an EEPROM. Then at Pic boot time the EEPROM is read for a set of pre difined parameters ....
Dave
Always wear safety glasses while programming.
Thanks Dave, but thats where my brain gets foggy. For instance I can see how I would put a timer value in the EEPROM, then read it at boot time. But what if the user doesn't want to use the timer at all? Do I have an IF NoTimer then skip the timer section? And then would this get checked every time through the loop? that seems like the wrong way to implement it. But I can't think how to do it.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
I think this is something like you want. It is quick and dirty with ON INT
Code:' 18F6680 24FC1025 '<FL_PIC18F6680>' DEFINE OSC 20 @ __CONFIG _CONFIG1H, _OSC_HS_1H @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H @ __CONFIG _CONFIG4L, _LVP_OFF_4L DEFINE LCD_DREG PORTG DEFINE LCD_DBIT 0 DEFINE LCD_RSREG PORTE DEFINE LCD_RSBIT 0 DEFINE LCD_EREG PORTE DEFINE LCD_EBIT 1 DEFINE LCD_BITS 4 DEFINE LCD_LINES 4 DEFINE LCD_COMMANDUS 3000 DEFINE LCD_DATAUS 150 PAUSE 1000 DPIN VAR PORTB.2 'I2C DATA PIN CPIN VAR PORTB.1 'I2C CLOCK PIN ADDR VAR WORD DATI VAR BYTE[45] DATO VAR WORD BOOT: LCDOUT $FE,1,"BOOTING" ADDR = 1 'FOR TESTING DO A WRITE/READ TO THE EEPROM 'CHANGE THE VALUE IN I2CWRITE TO TURN THE 'TIMER ON OR OFF... THE SAME CAN BE DONE 'FOR T0CON FOR DIFFERENT PWM I2CWRITE DPIN,CPIN,$A0,ADDR,[1] PAUSE 100 I2CREAD DPIN,CPIN,$A0,ADDR,[INT_VAR] PAUSE 100 INT_VAR VAR BYTE INTCON.5 = INT_VAR 'ENABLE/DISABLE TMR0 T0CON = %10000000 ON INTERRUPT GOTO TLOOP MAIN: LCDOUT $FE,1,"RUNNING" PAUSE 100 GOTO MAIN DISABLE TLOOP: INTCON.2=0:TOGGLE PORTG.4 RESUME: ENABLE
Dave
Always wear safety glasses while programming.
Thanks Dave, starting to have the fog clear a little now.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Bookmarks