individual bit access on dsPIC

Discuss about beta versions of mikroPascal compiler.
Post Reply
Author
Message
jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

individual bit access on dsPIC

#1 Post by jpc » 29 Oct 2006 11:25

30F4013 , EasydsPIC2 , default config , dsPascal 4.0

while working on some code i needed accessing individual bits and ( not sure this is legal) programmed something like this :

Code: Select all

program tmp;
var i : byte;
begin
  latb := 0;
  trisb := 0;
  while true do
  begin
    for i := 0 to 12 do
    begin
      latb.i := latb.i xor 1;
      delay_ms(300);
    end;
  end;
end.
As such it seems to work but after the first pass through the loop(all PORTB LEDS on my EasydsPIC2 board are on by then ) the bits 0..7 are switched off one by one ( as expected) but arriving on bit8 , the remaining bits (RB8..12) are ALL switched off . As the loop advances the bit's 9..12 are inverted ( again as expected) but from now pattern evolves strange. Then i tested the same but counting from 8 to 12 , same strange behaviour , usefull for next christmas perhaps but not what i needed now. Any enlightment would be welcome .

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: individual bit access on dsPIC

#2 Post by zristic » 30 Oct 2006 09:54

We will check/fix this before Santa Clause.

Post Reply

Return to “mikroPascal Beta testing”