[1] I'm trying to use the debugger an example program. When I try single stepping over functions, it works twice, then I get an error "!!! E R R O R !!! Can not execute instruction. Board does not reply. Fast Single Step Executing(PC=1134). Please wait..." This single step never completes. Why ?
P1.5 port pin of 8051 is used by secondary (PIC) processor to change its mode. Hence P1.5 should not be used by user applications except when communicating with the secondary processor to set LCD contrast or PWM output. If P1.5 is cleared for more than 2 seconds it will restart the whole system.
If you put a breakpoint on a line that changes P1.5, you may see the error:
!!! E R R O R !!! Can not execute instruction. Board does not reply.
Fast Single Step Executing(PC=1134). Please wait...
In order to pass through this line, please set a BreakPoint somewhere after this line and use the "Go"
command. Also, this technique will help you skip over through delay(...) ; lines quickly
[3] Which memory model of Micro C should I use with 8051 Debugger ?
We recommend MEDIUM model which is more suitable for AT89C51ED2 if you are using the debugger with our MINI-MAX/51-C2 board. You can use different memory models depending on the requirements of your particular hardware if you are using other boards.
[4] How does the debugger and an external application share the PC's serial port ?
You can not run any external Windows application to send any data to COM port because Micro-IDE occupies this port. In other words, Windows will not return correct handler if your application tries to open the same COM port that the debugger is using. While the debugger is running, you could send data to the 8051 only using the Terminal window of Micro-IDE. To debug your application you can use Micro-IDE terminal window and Go & BreakPoint execution.
[5] How should I configure the debugger checkboxes under the Project->Settings window ("Debugger") tab ?
It shows these checkboxes:
Simulate Interrupts
Simulate Timers
Simulate Serial Ports
Use Hardware Ports in Simulation
All these settings apply only to the 8051 Simulator. Please note that simulation of peripheral modules like Timers,UART, etc. takes some time. In order not to slow execution under the Simulator, you can disable these peripheral modules if you do not use these modules in your program.
"Use Hardware Ports in Simulation" option provides a more realistic environment under 8051 simulator if you already have target hardware. In this case, your 8051 program is still executed as a simulated program but real the port I/O will reflect the correct states of real 8051 port pins.
[6] The debugger occupies 2K on board. Does this 2K reside within our MCU's program code, or elsewhere?
The debugger occupies first 2K of the 8051 program memory. The program memory above the first 2K ( starting at address 0800 hex ) can be used for user programs. If you are programming in Assembly language, start your program using
ORG 0800h If you are using Micro C, it uses 0800 as default so no action is needed ( unless you have edited the startup libraries yourself to specify a different startup address ).
While 8 or 16-bit MCUs, such as 8051 and 80251 microcontrollers, can be sufficient for entry level edge objects with minimum security, more and more IoT objects with embedded RTOS and upgradable firmware need the enhanced computing capabilities of 32-bit MCUs due to the increasing integration of sensors along with the necessary security-related processing.
Article The future of the 8051 legacy upgraded for the Internet of Things (IoT) DOLPHIN INTEGRATION - 2015/02 - 5 The micro-architecture has been carefully designed to reduce the rate of memory accesses which contribute for a large part to the power consumption of systems with such consuming memories as Flash, or with complex bus architectures. This is achieved thanks to:
I have two switch consoles, one lite and one original from way back when. I've not touched them for a month or so and today when I've tried to go online they've both started throwing error code 2160-8051 I've never experienced connection issues with either console and everything else connected to the WiFi at home is working as it should.
When using an 8051-based microcontroller, care must be taken in selecting an external clock reference to ensure that the timing requirements of the controller's serial interface are met. Typically, the 8051 serial port is used with an RS-232 transmitter/receiver to provide a serial communication link to another processor or host processor. The RS-232 specification has specific timing requirements, which must be met to guarantee communication to all other devices using this protocol. 8051-based processors generate their serial port timing using a combination of external timing reference (crystal or clock) and internal programmable divider chains. This application note demonstrates how the external clock requirements can be met using an EconOscillator and provides calculation assistance in programming the 8051 internal serial port control registers.
When selecting a clock, two factors deserve careful consideration: clock rate and clock accuracy over the operational life span. In an 8051 microprocessor system, the use of RS-232 serial communications often determines the system clock rate. Consider, for example, asynchronous mode 1 serial communication using a 12MHz clock (the maximum clock rate for the original 8051). Table 1 shows the timer 1 auto reload values required to establish standard baud rates.
The DS1077 comes in various base varieties, with the internal oscillators running at 133, 125, 120, 100, and 66.667MHz. Using the internal divider chain to slow them down enough for an 8051 application, in theory any of these parts could be used. However, if you plan to use the serial port of your 8051, you should select the base part that best fits your microprocessor's needs, depending on both the baud rate required and baud rate generation formula provided with your microprocessor.
In the case of the 8051 microprocessor in our example, oscillator frequencies of 11.059MHz and 22.118MHz were desirable, and an approximately 3% error rate was tolerable for baud rate generation. If you use the 66.667MHz base part (DS1077-66), you would be able to divide the base frequency by six (6) down to 11.111MHz. This has a small error from the ideal frequency of 11.059MHz (0.47%), and the error remains acceptably low even with a worst-case deviation of 1.25% from the programmed frequency. Thus, the DS1077-66 allows a maximum error of 1.72% from the desired frequency of 11.059MHz, which is adequate for communication at rates up to 28.8kbps.
If you are using an 8051 with a higher allowable clock rate such as the DS87C520 (33MHz maximum clock rate), you could simply divide the clock rate by three to 22.222MHz. The maximum error is still fine for communication at any of the 22.118MHz baud rates. The higher clock rate also provides a higher level of processor performance for your other application needs.
The big advantage in using the DS1077 for an 8051 design is flexibility. A design that started out using an original or equivalent 8051 microprocessor (12MHz maximum clock rate) can be simply upgraded by reprogramming the oscillator and replacing the microprocessor. Depending on the design, you may even be able to reprogram the DS1077 in-socket. If you are using the 40-pin DIP version of the 8051 microprocessor, Analog Devices and many other companies make several 100% compatible replacement chips. The fastest of them all, Analog Devices' DS89C430, offers a 50x performance increase over the original 8051 design, and has several resources available, including watch-dog timers and power management, that were not available on the original 8051. Other chips, such as the DS87C520, can provide up to an 11x-performance increase. (Analog Devices also makes other versions of the 8051 that have PWM and ADCs for control applications, but they are not available in the 40-pin DIP package.)
To use the DS1077, you will need to establish a way to program its EEPROM registers.Once the DS1077 is programmed, the schematic shown in Figure 1 shows how to wire the DS1077 for proper operation with an 8051 microprocessor. Note that the output of the DS1077 goes into XTAL1, and XTAL2 is not connected. XTAL2 is normally the crystal oscillator output of the 8051. Connecting anything to this pin will just load the microprocessor down, which is not necessary when any auxiliary clocked device can be connected in parallel with the microprocessor on XTAL1. (This is assuming that the joint loading of the auxiliary device and the 8051 does not exceed the output current specification of the DS1077.)
I need to configure the 8051 uart dataframe as (5 to 8 bits of wordlength),(1,1.5,2 parity bits), (even,odd and none parity ) through coading is it possible or 8051 supports only (8bit and 9bit data format).
As to the workflow and the final register values, given the instructions, pen and paper is a first learning step. It is overkill here, but for larger code, you can turn to emulation (it seems unicorn doesn't support 8051, a search engine will let you know of alternatives).
Notes:
Port numbers in computer networking represent communication endpoints. Ports are unsigned 16-bit integers (0-65535) that identify a specific process, or network service. IANA is responsible for internet protocol resources, including the registration of commonly used port numbers for well-known internet services.
Well Known Ports: 0 through 1023.
Registered Ports: 1024 through 49151.
Dynamic/Private : 49152 through 65535.
TCP ports use the Transmission Control Protocol, the most commonly used protocol on the Internet and any TCP/IP network. TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and that packets will be delivered in the same order in which they were sent. Guaranteed communication/delivery is the key difference between TCP and UDP.
UDP ports use the Datagram Protocol. Like TCP, UDP is used in combination with IP (the Internet Protocol) and facilitates the transmission of datagrams from one computer to applications on another computer, but unlike TCP, UDP is connectionless and does not guarantee reliable communication; it's up to the application that received the message to process any errors and verify correct delivery. UDP is often used with time-sensitive applications, such as audio/video streaming and realtime gaming, where dropping some packets is preferable to waiting for delayed data.
When troubleshooting unknown open ports, it is useful to find exactly what services/processes are listening to them. This can be accomplished in both Windows command prompt and Linux variants using the "netstat -aon" command. We also recommend runnig multiple anti-virus/anti-malware scans to rule out the possibility of active malicious software. For more detailed and personalized help please use our forums.