From: KHMan <kei...@gm...> - 2011-11-07 11:58:34
|
On 11/7/2011 7:21 PM, Gál Zsolt wrote: > I examined the compiled code, and I found a big problem in it. That is > caused by the assembly parts of the wait function. > Here we are: > > clrwdt > movlw 0x42 > movwf 0 > decfsz 0, f > goto 0x102 > nop > > If you are using pointers the compiler will use the FSR register for > it. In your code you are using the 0x00 reg which is the INDF reg. The > FSR is pointed of the last used register which should be actually the > (*s). That register will be used trough INDF in your delay routine. So > that cause the problem. Good catch. U da man :-) > It is unusual to make cblock into inline assembly. You have to make a > global variable for using this type of delay routine. You have to use > BANKSEL also. >[snip snip] -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia |