ali_cmi
Junior Member level 2
Hello,
I am trying to interface a Color Sensor (ADJD-S311-CR999 Miniature Surface Mount RGB Digital Color Sensor) with PIC 18F452. This sensor communicates with a peripheral using I2C protocol and is quite handy (as people say it).
The problem I am facing is that when I try to read sensor gains, the PIC somehow resets itself although it is being locked in a while loop. WDT is turned off so I guess that reset rules out. I was suspicious of Stack Overflow Reset (don't know anything about it---came to know when I ran into project settings in MikcroC Pro for PIC).
And another amazing thing, unlike the WDT reset which is periodic (2.3s reset), the controller resets randomly as sometimes the whole program executes and sometimes it breaks due to reset.
The worst part: I use Proteus for general simulations (actually I do for all simulations) and it does not have a model for this or any color sensor. So, I have to debug the code line by line and it is painful. :\
Any help would be appreciated on how to stop controller reset. I have provided the code here.
Also, Please refer to me a better simulation software than Proteus. I know PSpice and Multisim but Proteus is handy for most of the jobs.
I am trying to interface a Color Sensor (ADJD-S311-CR999 Miniature Surface Mount RGB Digital Color Sensor) with PIC 18F452. This sensor communicates with a peripheral using I2C protocol and is quite handy (as people say it).
The problem I am facing is that when I try to read sensor gains, the PIC somehow resets itself although it is being locked in a while loop. WDT is turned off so I guess that reset rules out. I was suspicious of Stack Overflow Reset (don't know anything about it---came to know when I ran into project settings in MikcroC Pro for PIC).
And another amazing thing, unlike the WDT reset which is periodic (2.3s reset), the controller resets randomly as sometimes the whole program executes and sometimes it breaks due to reset.
The worst part: I use Proteus for general simulations (actually I do for all simulations) and it does not have a model for this or any color sensor. So, I have to debug the code line by line and it is painful. :\
Any help would be appreciated on how to stop controller reset. I have provided the code here.
Also, Please refer to me a better simulation software than Proteus. I know PSpice and Multisim but Proteus is handy for most of the jobs.