I have a custom board equipped with a 8051F582-IM, the implemented circuit for the C2 and RST interface is attached.
With the weak pull-ups activated (XBR2 = 0x40) there are no issues with debugging over C2 using the USB Debug Adapter.
With the weak pull-ups disabled (XBR2 = 0xC0) I have the following behaviour:
- If I set a break-point before my main-loop it (almost every time) re-triggers the same break-point, or with multiple break-points it "jumps" backwards as if the device did a reset.
- If setting a break-point inside the main loop (or no break-point at all), everything works fine. As well pausing and continuing execution works. Have had a program running for 2-3 hours now without an issue.
- The debugger seems to have more communication faults as well. Forcing me to un-powered it, and restating Simplicity Studio in order to get the debugger up and running again.
The PCB track for the C2 interface is no more than 20-25 mm with the pull-up located on the far side when seen from the MCU. The debugger connects to the PCB using its ribbon cable (C2D, C2CK and ground connected).
The code that is executed before the main loop is the initialisation of the device registers for XBAR configuration, SPI, interrupts, and Timer0, plus setting a digital out to low (not being the RST pin). VDD reset is disable.
Any ideas?
Edit: Corrected device type
Issues with resets and/or debugger when disabling weak pull-ups (external pull-up implemented)
I have a custom board equipped with a 8051F582-IM, the implemented circuit for the C2 and RST interface is attached.
With the weak pull-ups activated (XBR2 = 0x40) there are no issues with debugging over C2 using the USB Debug Adapter.
With the weak pull-ups disabled (XBR2 = 0xC0) I have the following behaviour:
- If I set a break-point before my main-loop it (almost every time) re-triggers the same break-point, or with multiple break-points it "jumps" backwards as if the device did a reset.
- If setting a break-point inside the main loop (or no break-point at all), everything works fine. As well pausing and continuing execution works. Have had a program running for 2-3 hours now without an issue.
- The debugger seems to have more communication faults as well. Forcing me to un-powered it, and restating Simplicity Studio in order to get the debugger up and running again.
The PCB track for the C2 interface is no more than 20-25 mm with the pull-up located on the far side when seen from the MCU. The debugger connects to the PCB using its ribbon cable (C2D, C2CK and ground connected).
The code that is executed before the main loop is the initialisation of the device registers for XBAR configuration, SPI, interrupts, and Timer0, plus setting a digital out to low (not being the RST pin). VDD reset is disable.
Any ideas?
Edit: Corrected device type
this makes no sense, so a couple of guesses
I once found a 1M resistor soldered in place of a 1k
is the 1k pullup actually connected
Indeed. It makes no sense.
The pull-up is 997 ohm, the series resistors 100 ohm each. Connection of pull-up to VCC is OK.
Other ideas?
Please note that I edited my post correcting my device. It is 8051F582-IM, nothing else.
When I get this behaviour that a break-point "re-triggers" or I'm "jumping" back to a previous one, I notice that my variables get corrupted in the "Expression" watch. For an instance I have an U32 counter variable incremented every 1 ms by Timer0. It is always set to 0 on initialisation, but when the "jumping" starts it can all of a sudden read arbitrary integer numbers. If I click on the "Reset the device" button, I do get expected behaviour until the "jumping" kicks in again.
Also, how shall I configure the C2D pin? I noticed I have set it to analog, opens-drain. Tried to set it to default value, digital open-drain. No difference.
re programming pins
by sheer necessity they must work after reset, so I would just leave them alone in the default state
are you doing pin sharing?
is this your only board, or can you try programming another?
I fear that 'playing with' the programming pins you may have set one to push-pull and burned something in the programmer
No pin sharing. At the moment it is my only board.
I will check all wiring and connections again, must be something simple I have missed..
Good idea. I have a tool stick that I might be able to connect using C2. Will check later this week. Heading away on work.
Thanks!