The word mclr clears the selected bit. So, bit 0 of TRISB is cleared and
the dump shows $fe, as it should.
Peter J.
On 19/03/14 18:30, Thomas Buschhardt wrote:
> Hallo,
>
> Im a little bit confused about a very simple function. In the
> ff-tutorial (flash a LED) the PortB RB0 is set to an output with:
>
> $ff93 constant trisb
> 1 trisb mclr
>
> thats the bitmask 0000 0001 , but if I look in the datasheet of my
> PIC18F2620:
>
> Setting a TRISB bit (= 1) will make the corresponding PORTB
> pin an input (i.e., put the corresponding output driver in
> a high-impedance mode). Clearing a TRISB bit (= 0)
> will make the corresponding PORTB pin an output
>
> Thats confusing me, especially because the forth-program works. What
> is wrong in my mind?
>
> Bye Thomas
|