We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I have a problem using ISD51 to debug my code. AT first, I used the simulator to run my code and it works fine. Then I added ISD51.A51 into my project and also added ISDinit() and ISDcheck() to my code, changed the OPTION menu to enable ISD51 and compiled. The problem is that the code doesn't start running after loading (seems waiting). Can anyone help with it? Another thing: during compiling, I saw there were a few bytes overlap in code space. Does it matter? Thanks Frank ------------------------------------------- compiling LOG.C... compiling test.c... assembling Conf_tny.a51... assembling STARTUP.A51... assembling ISD51.A51... linking... *** WARNING L5: CODE SPACE MEMORY OVERLAP FROM: 0023H TO: 0025H Program Size: data=68.3 xdata=454 code=16180 creating hex file from ".\output\snake"... ".\output\snake" - 0 Error(s), 1 Warning(s).
Frank, Let's start with the obvious: 1) To generate your ISD51 code, make sure you have the symbol ISD51 defined. I don't see a header file included anywhere so I cannot tell. (Sorry if that is TOO obvious.) 2) You are calling ISDinit() BEFORE enabling interrupts. Try moving the call to ISDinit() to AFTER the ES and EAL settings. This may not be a big problem, but it could cause a timing issue in the handshake. 3) Better yet, remove the call to ISDinit() and just use ISDcheck() by itself. This function actually does the ISDinit() for you, after it sees the incoming 0xA5 from the debugger. ---- Note: The ISDwait() and ISDcheck() functions really don't do ANYTHING after the Serial Interrupt (ES) is enabled by ISDinit(). (In fact, ISDinit() doesn't do anything if called more than once, because it sees that the ES flag is already enabled.) ISDwait() and ISDcheck() are different from ISDinit() only in that they LOOK for an incoming 0xA5 from the debugger BEFORE they invoke ISDinit() which, in turn, merely enables the Serial Interrupt (by setting ES). Thereafter, just about everything (including further 0xA5 handshakes) is controlled by the Serial Interrupt servicing routine contained within ISD51.A51 (until such time as you explicitly disable the interrupt). ISDcheck() is useful if you want your code to run semi-normally in the ABSENCE of the debugger. ISDcheck() essentially performs a No-Op when it is called, UNLESS a 0xA5 is present on the UART Receive pin. Then, and only then, does ISDcheck() launch the ISD51 Interrupt as described above. Steve
Thanks Steve for your reply. I have the following comments. 1. I don't understand why I need a header file. I'm using PK51-kit and I can define ISD51 as Preprocessor Symbols in IDE option menu. 2. Calling ISDinit() after ES set seems meanless to me. If you check ISDinit(), ISD is ONLY initialized when ES=0. 3. As I said before, if I call ISDcheck() after ES=1 set, ISDcheck() will do nothing. Can you give more comments on above? Thanks. Frank
All our examples do not enable the serial interrupt (this is done by the ISD51 core. Therefore you should remove the line:
ES = 1
OK. After I removed that, nothing changed.
How come the Keil IDE keeps giving me an erro message "There was a wrong reply from the target system! Please check..."
Note: I used the Hyperterminal and Simulator to verify the code working properly before using ISD51.
Sorry about that. I must have been sleeping! I totally missed that fact that you were setting ES (which you should allow ISD to handle for you). No, you don't need a header if you set the symbols from within IDE. So you removed the setting of ES. Did you also remove the call to ISDinit()? (By the way, what chip are you programming for?)
Yes, I removed the ISDcheck(). My processor is C515C. Another funny thing is: when you hit the Debug button, sometimes the time of "connecting to ISD51" could take about 5 seconds up to 100%, but most times only about a half seconds. Why there is such a difference? I'm running the Keil software PK-51 under Windows 2000 OS.
Another note: 5 seconds connecting time seems always giving me "There was a wrong reply"; half second connecting time always giving me "Communication problem with ISD51".
Your code is simple enough. The only GUESS I would make right now is that you are having serial communications problems such as noisy line, bad DSR/DTR connection, or a baud mismatch. The two different error messages would support that, tending to indicate different data being observed across different attempts. But you say you can communicate with your processor via HyperTerminal, so that is odd. Did you say that you have seen the microprocesssor successfully send data to the PC via the UART? (When you send an 0xA5 to the application, it sends back 6 bytes which appear in HyperTerminal?)
Maybe some sort of Baudrate problem. I also guess that you have a problem with the COM interface between PC and hardware.
What I tested is that using the Hyperterminal with ISD51 undefined in IDE, from the source code above, you can see my board should send back any character I typed in the Hyperterminal windows. It did well.
I just tried the ISD51 code downloaded into my board using the Hyperterminal. I pressed the ALT + 0,1,6,5 (A5), then I got 4 characters in the Hyperterminal window from my board my every time. Does it sound correct?
Are you sure it's 6 characters, not 4 characters?
Frank, that sounds okay. Since Hyperterminal does not show hex values, only characters, all 6 characters may not appear to be there on the screen. Anyway, it sounds like you definitely have communication through the port, since ISD51 seems to have recognized your 0xA5. I think you've eliminated all the obvious issues. Let's see if anybody else has a new guess on this one. It has to be something simple.
Thanks. Now I'm guessing probably the Keil software has a ISD51 bug with the processor C515C, not sure in some DLLs or interface with the serial port. I asked my parter in Switzerland, who developed the board, about debugging the board using ISD51. They told me they failed and couldn't get it working. I'm just experiencing the same problem as them.