Good days! Sorry. I work with Keil .Vision3 V3.30a. Have some C8051F060 devices. When processing my programms under Debuger control don't have any problems. But after device FLASH programming and abort Debug Session I get some problem. When read microprocessor input ports I get not correct information about input signals. What is it?
Thank You! Sasha, Ukraine.
"When processing my programms under Debuger control don't have any problems"
Do you really mean the debugger - ie, the code running in your target?
Or do you mean the Simulator - ie, the code running on your PC?
"When read microprocessor input ports I get not correct information about input signals"
In what way are they "not correct"? You need to clearly understand the problem before you can solve it!
Similarly, you need to clearly explain the full situation before anyone else will be able to help you:
- What is the system supposed to do?
- What is actually happening (in detail)?
- What have you done to try to explain the difference?
I mean a code running on my target.
The target port P5 initialized as an input port: ... P5MDOUT = 0x00; P5=0xFF; ...
Then there is such fragment in my program: ... TXbuffer[2] = str[P5]; ..., where str[...] is an array of unsigned chars. On P5 comes some determined signals. As a result I have in TXbuffer[2] an transformed by str[] image of this input signal. But when programm processing in the target without Debug Session I have constant in TXbuffer[2] while input signal on P5 are changes. I detect it by reading TXbuffer[2] when realize CAN-interchange of data with my target.
When using the debugger, are you single-stepping or running at full speed.
If you're single-stepping, it could be a timing issue.
Do you leave the debugger cable attached even when the code is running in non-debug mode? Maybe there is some interaction with the "idle" signals on the debug cable? Or a grounding issue?
Are you sure that the code in the Flash is exactly the same as the code that was running under debug? I'm sure we've all made the embarassing mistake of failing to download after making changes...!
Thank You.
I running program at full speed when using the debugger. But I use interrupts. I am sure (I think so) that the code in the Flash is exactly the same as the code that was running under debug.
You says: "...Do you leave the debugger cable attached even when the code is running in non-debug mode? Maybe there is some interaction with the "idle" signals on the debug cable? Or a grounding issue?..."
It's most unknown moments for me, because I am't hardware specialist. it's seems to me that in non-debug mode programm don't work correct any with the debugger cable or without.