hello,
the compiler is the last version ;Program compiled by Great Cow BASIC (0.9 11/5/2014)
the devices are 16F887 or F676 ..
the problem exists sense i use GCB, (0.9 15/11/2009) compiler version.
of course, between two variables it is not a problem but for port pin it s a glitch !
ok for the logic test.
brico31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, this is a limitation of GCB. It is the way GCBASIC addresses individual bits. On a PIC, it uses btfss, btfsc, bsf and bcf instructions, all of which require the individual bit to be hard coded. A workaround.
~~~~
'Prepare a bit mask with only the correct bit set
TempMask = 0
Set C On
Repeat var1
Rotate TempMask Left
End Repeat
'set port OR you can OR with port bit to set as this... portc = portc OR TempMask
portc = TempMask
wait 100 ms
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the PORTC, 2 bit is set and the Var1, 5 is set then the i/o pin will see a glitch that drives it to ground very quickly. I've seen this cause issues in previous designs with other BASIC compilers so why can't a 'btfss' be added to the routine to test it before clearing the bit?
btfss VAR1,5 <==== Why can't this be added?
bcf PORTC,2
btfsc VAR1,5
bsf PORTC,2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
for example, this syntax :
the source syntax GCB : portc.2=var1.5 (var1 is a byte)
the compiler result :
bcf PORTC,2 => here is the little problem, in first one the bit is always cleared
btfsc VAR1,5
bsf PORTC,2
in first, the compiler, clear the bit.
I think that it would be necessary to pass by a temporary variable then copy the result in the portx
Have you a solution without modifying the compiler ?
thinks
best regards.
Brico31
More detail needed.
What Device?
What Compiler level are you using?
You could create your own logic.
if var1.5 = 1 then
PORTC.2 = 1
else
PORTC.2 = 0
end if
hello,
the compiler is the last version ;Program compiled by Great Cow BASIC (0.9 11/5/2014)
the devices are 16F887 or F676 ..
the problem exists sense i use GCB, (0.9 15/11/2009) compiler version.
of course, between two variables it is not a problem but for port pin it s a glitch !
ok for the logic test.
brico31
Sorry, this is a limitation of GCB. It is the way GCBASIC addresses individual bits. On a PIC, it uses btfss, btfsc, bsf and bcf instructions, all of which require the individual bit to be hard coded. A workaround.
~~~~
'Prepare a bit mask with only the correct bit set
TempMask = 0
Set C On
Repeat var1
Rotate TempMask Left
End Repeat
'set port OR you can OR with port bit to set as this... portc = portc OR TempMask
portc = TempMask
wait 100 ms
ok for the limitation.
I shall by-pass when it will be necessary.
thank you.
If the PORTC, 2 bit is set and the Var1, 5 is set then the i/o pin will see a glitch that drives it to ground very quickly. I've seen this cause issues in previous designs with other BASIC compilers so why can't a 'btfss' be added to the routine to test it before clearing the bit?
btfss VAR1,5 <==== Why can't this be added?
bcf PORTC,2
btfsc VAR1,5
bsf PORTC,2