Jump to content

Picant 5.0.7 debugger issue ?

Recommended Posts

I am trying new version of PICANT 5.0.7 (C2C comp.) and I have problems with the debugger (in debugging mode):


when I set interrupt flag INTF in INTCON register (INTE=GIE=1), after this tick counter count still 16 ticks (4 instr.) to reach _interrupt code reached in next instruction cycle (4 ticks) - that's it also in real PICs, isn't it ?



when I want to change PORTA or PORTB values (in Registers bar), it is strange, sometimes is change successful (not often), sometimes no (or is set something else) - for ex. I change PORTA (from 0) to 120, but debugger set 104 in next cycle or bit0-PORT B is impossible to set (I set it, but this setting is overwrited in next instruction cycle) - in 5.0.6 version is everything OK.


 Is there something, what I dont know? :)  I try it with the same code and in previous version (5.0.6) is everything with debugger and entering to interrupt OK (target is PIC 16F819).

 But code compilation is OK in both versions indeed and final code works well in my circuit.    

                                               Regards Petr M.

Link to post
Share on other sites

The things you are observing are due to version 5.0.7 more closely simulating the actual device, they are not bugs :)


1] The interrupt latency (time to get into interrupt routine) on the Pic 16 series is 12 to 16 clock cycles, depending on when the interrupt flag becomes set. So the this operation is just as the actual device. The interrupt latency was not simulated in version 5.0.6.


2] In version 5.0.6 the port existed as a register. In version 5.0.7 the port exists as as an actual port. When a port is written it sets the writes to the output register, when read (even in output mdoe) it reads the actual pin voltages. Port A bit 4 has a sink only output, that means it can pull a load to 0V or float. This means if no external load is connected, when Port A bit 4 is set to one, it just floats. So when it is read it will be read as zero. Try connecting the DVM pluging to RA4 to measure the voltage on this pin. So this behaviour is just as the actual device :).

Port B bit zero - please check that you don't have a pluging driving this pin, if you connect the signal generator plugin to this pin, then it will drive that pin hard, so the pin voltage may not be what you expect. Check the pin voltage using the DVM (digital volt meter) plugin.



In your actual circuit you may have a load on RA4 that pulls it high when 1 is written to the Port A bit 4, then you actual circuit may work as you expect, but the simulator does not.


In general it is not good practice to read a port to get that last value written, because what is read back is the current voltages on the pins, not what was written.





Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...