Thanks for taking time to read and reply! I’m in over my head when it comes to coding a uC. If I had board space designing a circuit using CMOS logic would be straight forward.
I see in the mega165 datasheet some mention of the status byte changes when an interrupt occurs and on completion of the subroutine. I don’t see any change when simulating but I’m not sure I’m looking in the right place. In the datasheet it’s assumed that the coding is for a C compiler NOT BASCOM…
When this problem is resolved I’ll make a point out of posting how it was fixed…
to be clear : int0 for the atmega165 64 pin package is at pin 26 (pind.1)
there are simple tests to see if a pin works :
Code:
configpind.1asinput portd.1=1'activate internal pull up
configportc=output
do ifpind.1=0then portc=0 else portc=255 end if loop
then apply signal using a wire ot whatever and port should follow this signal.
that would be one of the first tests.
then to test int registers :
Code:
configportc=output enableint0
do if eifr.0=1then portc=255'or do some led
eifr=1'reset the flag !!! end if loop
notice that this sample has no interrupt label, it just test if the flag becomes set.
in this case that is EIFR register bit 0.
this flag is reset to 0 when an interrupt routine is executed. but we did not provide this so we must manual reset this flag by writing a 1 to it.
when you also provide a label to be called using ON INT0 SOMELABEL that label will be called.
the simulator will sim just enough to get the code going. it is not intended and is not a total representative image for the internal processor. _________________ Mark
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum