Consider using ucSim emulator for troubleshooting. It's easy to
extend the emulator to create virtual hardware. For example, with
a few lines of code(putc(stdout)) you can create a virtual console
on your 8031. So whenever a write is done to some selected port,
you just call putchar() or whatever. Create a virtual stepper
motor, no problem just track the output bits and add some code
to emulate the stepper. For example a simple counter that counts
stepper position and displays to screen or dumps to file.
I used this and found my code was fine, my problem was an
intermittent crimp on a stepper wire.
I've got a few examples on my web site if you are
interested in this approach.
The idea of a virtual debug port console is very handy,
you can make #if DEBUG macros to create a debug version
of the code.
> Hi there,
> I'm thinking about adopt sdcc for my hobbistic robot projects, targeting various
> '51 chips. I'm not yet familiar with the whole doc, forgive me if I ask for
> trivials stuff.
> I'd like to discuss a bit about the debug of the application code. I've quite
> experience with 8052, having worked in some professional application. In those
> cases I've had access to an emulator that I can not afford at home, of course. I
> would avoid to debug using just printf on the serial port, I'd like to keep at
> least the support of a ROM monitor to assist along the way.
> What are your opinion/experiences? Could you briefly describe how you debug your
> code in sdcc environment? Does anybody tried to integrate a monitor?
> Any experience with Dunfield's monitors?
> Thanks you, Best Regards
> Sdcc-user mailing list