
Originally Posted by
Charles Linquis
It will take me a bit longer than I thought. I think you said you were using a 16F chip. Bad news for me! The 16Fs are missing some of my favorite ASM instructions.
I don't have any 16F stuff lying around, I'll have to find one.
Thats alright I have been trying to get it to work with the HPWM but I just dont quite understand how to get it to work. I put a LED on PORTB.0 and typed the following code but nothing happens to the light:
Code:
DEFINE OCS 4
C1 VAR WORD
DEFINE CCP1_REG PORTB 'no clue what this does but I think I need it for the following line
DEFINE CCP1_BIT 1 ' because 1 = portb.0 according to the manual I think?
FOR C1 = 0 to 255
HPWM 1,C1,1000
NEXT
I was thinking I could use this for my clock pulse of 4096 times like this:
Code:
FOR C1 = 0 TO 15
HPWM 1,127,frequency '50% duty/square wave
NEXT
for right now I have a second external clock hooked up that I am turning on with throwing a pin high for a couple milliseconds and it fixed what I am trying to fix but its not exact like I need it to be.
Thanks again for your time with this!
Bookmarks