Hi!
I have some code that puts data into the DDC channel. The processor waits until the data is read out, by polling the W bit of the DCC control register. If the Ulink is connected everything works fine, as it reads out the register and resets the bit.
Now another case: When the Ulink is not connected, the routine loops forever, as the W bit is never resetted.
Is there a way to determine before I write to the DDC , that the Ulink debugger is connected? In that case i could write some code that puts the debug output to the nirwana.
Sincerely Jens-Peter Oswald
Try the following function:
// Check if free for write int __dbg_free (void) { int r; __asm { MRC p14,0,r,c0,c0 // Read DCC Control AND r,r,#0x02 // Mask W bit } return (r); }
Pooling W bit in DCC Control register, you can determine does the debugger read output.