Jump to content

Zapo

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Zapo

  • Rank
    Newbrie
  1. This could be true because I also noted that the amount of memory available is much smaller than 256 bytes. The 818 only has 128bytes I think... Well, if you happen to find a bug, are you going to publish some patch shortly or should I find some workaround for this problem temporarily?
  2. Sorry, previous postingS "took off" !!! I might have found a bug in the compiler. I'm using the 16F819 CHIP and I think there is a bug when swithcing banks. Compiler version is the newest 5.2 (registered). I have declared "global" variable FLAGS at top without giving the exact location. ** CLIP from C-source ** char FLAGS; ... void initChip() { porta = 0; portb = 0; trisb = 0; trisa = 0; FLAGS = 0xff; FLAGS = 0x00; } ** CLIP END ** ** Resulting ASM-Code ** *Definition part * ## The flag goes to address 0x51, which is in BANK0 _FLAGS equ 0x51 ;1 * Code Part * ## Bank is set to 0 correctly bcf STATUS, RP0 bcf STATUS, RP1 clrf _porta ;;;;;;;; portb = 0; // Init PORTB clrf _portb ;;;;;;;; trisb = 0; // Set all PORTB as outputs. ## Bank is set to 1 bsf STATUS, RP0 clrf _trisb ;;;;;;;; trisa = 0; // Set all PORTA as outputs. clrf _trisa ;;;;;;;; FLAGS = 0xff; // Zero all FLAGS ## Current BANK is still 1, even the FLAGS variable ## is in BANK 0 movlw D'255' movwf _FLAGS ;;;;;;;; FLAGS = 0x00; // Zero all FLAGS clrf _FLAGS ** CLIP END ** As far as I know, the compiler should check the variable addresses and switch the banks when necessary. I think this didn't happen in this case? Or am I just doing something wrong?
×
×
  • Create New...