Hallo, i'am writting a dll, in order to model bouncing switches. The use of AgsiSetSFRReadValue should allow the setting of data on a port without manipulation the corresponding SFR.Following the documentation i had installed a watch on P4 and the corresponding Readroutine.
Agsi.SetWatchOnSFR(P4,P4Read, AGSIREAD); static void P4Read(void){ DWORD hh=5; Agsi.SetSFRReadValue(hh); }
and the microcontroller program:
void main(void){ unsigned char aa=0; while(1){ aa=P4;} }
The value of aa was never changed according to the P4Read Function. Can anybody give me a tip or a workaround? Does SetSFRReadValue really work?
Thanks Gerhard
What microcontroller are you using ?
What memory model are you using ?
Could it be that the compiler tries to locate the variable aa in (nonexistent or deactivates) xdata memory ?
Hallo, i'am using a 80C517. The variable is defined as global unsigned char. That means the data area is used. Its the small memory model. In assembly view the variable seems to be related to the Accu .
Gerhard Schäfer
In assembly view the variable seems to be related to the Accu .
Can you post the assembly code ?