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.
Hi,all I have encountered a problem in debugging my appllication code with ISD51. This problem is that I could not select a HEX MODE for serial window#1. As the ISD51 technical document said, I added the ISD51.A51 and ISD51.h in my project. Further more, I also added the startup.a51 module into the same project. In my main C function, I configured the Timer 2 as the baudrate generator of Serial Port UART and the the source code showed below. After all , I select the simulation debug utility of uVision2 to see if the ISD51 was initialized successfully. As the ISD51 Troubleshooting part showed me, I did all the steps like following. 1.Select Project - Options for Target - Debug: Use Simulator. 2.Start program simulation with Debug - Start/Stop Debug Session. This loads the user program in simulation mode. 3.Start running the user program (Debug - Go). 4.Entered the correct XTAL frequency in Project - Options for Target - Target - XTAL.(My selection is 11.0592MHz). when I start Go command, the simulated serial port showed me a desired Baudrate 9600. 5.After then I openned the serial communication window (View - Serial Window#1), right-clicked in the Serial Window and want to select Hex Mode from the context menu. But in step, I failed. The ASCII mode could not be disabled. I also entered sin=0xA5 in the Command Window to Input a 0xA5 character in the serial input stream. The result in serial window#1 displayed a error code which I could not recognize, instead of the 0xF7 followed by six more hex values. I do not know what is the problem and how to solve it. I wondered if you could give me hand? Thanks a lot.
/*************************************************************************************/ /* This application source code is used for study the ISD51 utility of Keil uVision2 */ /* System features are listed below */ /* Evaluatiom Board--------ZLG MCU/CPLD(Altera) Evaluatuion Board */ /* MCU -------- Philips P89C61x2BA Crystal ------------ 11.0592MHz */ /*************************************************************************************/ #include <reg52.h> #include <intrins.h> #include "isd51.h" #define timer_2 void delay(void){ long i; i = 0x800; while(i--); } void main (void) { #ifdef timer_1 /* use timer1 as baud rate generator */ SCON = 0x50; /* SCON: mode 2, 8-bit UART, enable reicever */ TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ TH1 = 253; /* TH1: reload value for 9600 baud @11.0592MHz */ TR1 = 1; /* TR1: timer 1 run */ TI = 1; /* TI: set TI to send first char of UART */ EA = 1; /* EA: global interrupt enbale */ #endif #ifdef timer_2 /* use timer2 as baud rate generator */ T2CON = 0x34; RCAP2H = 0xFF; RCAP2L = 0xDC; /* 9600 baud @ 11.0592MHz */ SCON = 0x50; /* enable serial uart & receiver */ EA = 1; /* Enable global interrupt flag */ #endif ISDinit(); while (1){ _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); P1 = 0x00; _nop_(); _nop_(); _nop_(); delay(); P1 = 0xff; delay(); _nop_(); _nop_(); _nop_(); } }