Hank,
You got a 12F683? If so, and if you want to experiment, connect an LED to GP0 (anode) and GP5 (cathode) and try the program below. The circuit doesn't use a current limiting resistor, relying instead on the RDS(on) resistance of the I/O pin output FETs.
The program fades the LED through sixty four gamma corrected brightness levels spanning 256 1-usec BAM duty cycle steps with a 1280-usec frame rate (781-Hz refresh rate).
I'll also write something using the PWM module so that we can try 125-nsec PWM steps (with an 8-MHz clock).Code::020000040000FA:0600000083018501F128D7 :08000800F000030EF10083017A :100010000A08F2008A010408F3008C1074088500B5 :1000200083167608850077088500162878088500ED :100030000030FF3E031819281D287908850002307A :10004000FF3E0318202824287A08850074087407C6 :1000500074191030F41A0130F4000430FF3E031814 :100060002E28322800007B0885002030F418243028 :1000700074192830741A2C30F41A303084000C3083 :10008000FF3E031840287C0885007D08F5007409B0 :10009000F600F700F800F900FA00FB00FC00FD0094 :1000A0000130741820300018F6068018F706001981 :1000B000F8068019F906001AFA06801AFB06001BDA :1000C000FC06801BFD06840A0230F418203000185C :1000D000F6068018F7060019F8068019F906001AC6 :1000E000FA06801AFB06001BFC06801BFD06840A2C :1000F0000430741920300018F6068018F70600192D :10010000F8068019F906001AFA06801AFB06001B89 :10011000FC06801BFD06840A1030741A203000187B :10012000F6068018F7060019F8068019F906001A75 :10013000FA06801AFB06001BFC06801BFD06083031 :10014000FF3E0318A0287508850073088400720814 :100150008A00030E8300F00E700E09008A013F39F9 :10016000820700340134023402340234023403348E :1001700003340334043404340534053406340634BB :1001800007340834083409340A340B340C340D3481 :100190000E340F3411341234143415341734193426 :1001A0001B341D341F342234243427342A342D3494 :1001B0003134353439343D34413446344B345134A0 :1001C00057345D3464346B3472347B3483348C3410 :1001D0009634A134AC34B734C434D134E034EF3481 :1001E000FF340730990083169F0170308F000F1D78 :1001F000F72883123F30840080018403841AFC288E :100200002030F4000130AA000230AB000330AC0013 :100210000430AD000530AE000630AF000730B0004E :100220000830B1000930B2000A30B3008C019101EE :100230000530920083167F3092008C148312C030F8 :100240008B0010303321B60A361B2C293608AE201D :10025000A000212910303321B603B61B212936080E :10026000AE20A0002A29B500740820393406B4064F :0C027000340503193429350B332908002C :02400E00D43F9D :00000001FF
Cheerful regards, Mike




Bookmarks