Hi,
I guess what you want is one pulse every 4.32s, in other words a frequency of 0.2315Hz.
Since the Pause statement in the For-Next loop is shorter (1mS) than what your interrupt period is (65mS) the ISR will still run.Code:'Produce squarewave on PortB.0 period~4.32s, 50% dutycycle. Loop var Word Main: High PortB.0 For Loop = 0 to 2160 'Loop here for ~2.16s, tweak to match. PauseUs 1000 Next Low PortB.0 For Loop = 0 to 2160 'Loop here for ~2.16s, tweak to match. PauseUs 1000 Next Goto Main
However, your time-keeping will not be very accurate. You're only getting 983mS each second, give or take, 65536uS * 15 = 983040uS.
/Henrik Olsson.




Bookmarks