
Originally Posted by
Joe S.
Here is some code to do most of what your pic was originally programmed to do.
I think it will run on the demo, if it is too long then just comment out the last couple of statements in the main.
Code:
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
'DEFINE OSC 4
'DEFINE ADC_CLOCK 1
'OSCCAL=%10000000
'GPIO = 0 ' set all outputs low
TRISIO = %00000001 'Set GPIO.0 to input
cmcon = 7 'Disable analog comparators
ANSEL = 1
'PCON = %00000011 ' Bit 0 BOD 0=on 1=off bit 1 POR 0=on 1=off
ADCON0 =%00000011 ' SET CHANNEL 0 RT JUSTIFIED VREF - VDD
' BIT 7 1 LT JUSTIFY 0 RT JUSTIFY
' BIT 6 1 = VREF 0 = VDD
' BIT 5:4 UNIMPLEMENTED
' BIT 3:2 00 CH 0
' 01 CH 1
' 10 CH 2
' 11 CH 3
DELAY VAR WORD
main:
ADCIN 0,DELAY
DELAY = (DELAY * 4)
TRISIO = %11111001
GPIO = %00000010 'LED 7 ON
PAUSE DELAY
GPIO = %00000100 'LED 6 ON
PAUSE DELAY
TRISIO = %11011011
GPIO = %00000100 'LED 5 ON
PAUSE DELAY
GPIO = %00100000 'LED4 ON
PAUSE DELAY
ADCIN 0,DELAY ' RECHECK A/D AND RECALIBRATE
DELAY = (DELAY * 4)
TRISIO = %11101011
GPIO = %00000100 ' led 3 ON
PAUSE DELAY
GPIO = %00010000 'led 2 ON
PAUSE DELAY
TRISIO = %11001111
GPIO = %00100000
PAUSE DELAY
GPIO = %00010000
'PAUSE DELAY
goto main
After you play with these you may be ready to order PBP. Then you can UnComment the rest of this code.
Here is this hex:
Code:
:020000040000FA
:1000000052280F39A0000310A00DA00D1F08E039E1
:10001000200401389F000030A100323023209F14BB
:100020009F181028A1011E084D28A301A200FF302F
:10003000A207031CA307031C4D280330A100DF30D7
:1000400023201728A101E83EA000A109FC30031CD1
:100050002C28A00703182928A0076400A10F29282D
:1000600020183228A01C362800003628080010303E
:10007000A800A101A001A70CA60C031C452822087A
:10008000A00723080318230FA107A10CA00CA50C9F
:10009000A40CA80B3B2824084D28831303138312B8
:1000A0006400080083168030900083128501831657
:1000B00001308500831207309900831601309F00BC
:1000C00003308E00831203309F0000300120B800FF
:1000D0002108B9003808A6003908A7000430A2009A
:1000E000A3013720B8002508B9008316F930850030
:1000F0008312023085003908A30038081620043026
:1001000085003908A300380816208316DB308500E7
:100110008312043085003908A300380816202030E7
:1001200085003908A3003808162000300120B800E7
:100130002108B9003808A6003908A7000430A20039
:10014000A3013720B8002508B9008316EB308500DD
:100150008312043085003908A300380816201030B7
:1001600085003908A300380816208316CF30850093
:100170008312203085003908A3003808162010307B
:1001800085003908A3003808162065286300C628B2
:02400E00DC3F95
:00000001FF
I uncommented that which was commented.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks