hi,
An issue has arisen with a 16F877A with its portb linked to portb on a 16f876. This project has been working successfully for many months. I have the 16F877A set up with microcode ICD. I suspect that I will have to scrap the offending IC's however this raises a two issues which I wondered if anyone had any thoughts on.
The actual incident is as follows using PBP2.47 and the PM assembler: TrisB on the 16F877a = 255 and TrisB on the 16F876 = 0. I have a variable bit (T_C) used as a program indicator on the 16F877a. If I use code toggle T_C whilst in ICD mode all is well, yet when I compile normally once this toggle has been executed it seems to change the direction of portb and the 16F876 goes crazy and I am forced to manually reset.
However If I change the line from
TOGGLE T_C
to
T_C = T_C ^ %1
then all is well.
Should one only use the toggle command when it is connected to a pin either directly or through a variable, also as I understand from the manual that TOGGLE can also change pin direction, presumably therefore TOGGLE generates longer code than bit bashing.
and why should ICD compile be unaffected?
any thoughts or experience?
Bookmarks