andydawson
New Member
I have been trying to do some bit manipulations on a P12F675 and it doesn't appear to be working as I expected. BSF seems to set the right bit but clears all the rest. For example:
The following only leaves bit 5 on,
code assembler
$1405 BSF GPIO, 0
$1485 BSF GPIO, 1
$1505 BSF GPIO, 2
$1605 BSF GPIO, 4
$1685 BSF GPIO, 5
The following only leaves bit 4 on,
code assembler
$1405 BSF GPIO, 0
$1485 BSF GPIO, 1
$1505 BSF GPIO, 2
$1605 BSF GPIO, 4
WHEREAS if I write a word of all ones to GPIO the right lights come on so I have the TRISIO and other registers set up ok
etc etc.
What an I doing wrong. Any Ideas?
(I am working with EASy PIC 5 and as the basic compiled code wasn't working I started looking at the actual assembler- I have tried two PICs)
The following only leaves bit 5 on,
code assembler
$1405 BSF GPIO, 0
$1485 BSF GPIO, 1
$1505 BSF GPIO, 2
$1605 BSF GPIO, 4
$1685 BSF GPIO, 5
The following only leaves bit 4 on,
code assembler
$1405 BSF GPIO, 0
$1485 BSF GPIO, 1
$1505 BSF GPIO, 2
$1605 BSF GPIO, 4
WHEREAS if I write a word of all ones to GPIO the right lights come on so I have the TRISIO and other registers set up ok
etc etc.
What an I doing wrong. Any Ideas?
(I am working with EASy PIC 5 and as the basic compiled code wasn't working I started looking at the actual assembler- I have tried two PICs)