??? 09/04/04 21:19 Read: times Msg Score: +2 +1 Informative +1 Good Answer/Helpful |
#76888 - RE: Simulator Responding to: ???'s previous message |
What's wrong with your code to start with (as others have already pointed out) is that there are no comments. You need to comment your code so that it is clear what you are attempting to do. Also for yourself! You will be surprised that while commenting your code, you may even start to understand where the problem is.
Otherwise, techniques like JNB p1.0,$ are best quickly forgotten. They are the number 1 reason why less experienced programmers all too quickly reach the false conclusion that they need "a multitasking operating system" to build any meaningful projects (boy have we seen an outpour of them in the past few weeks...). A better approach for your project would be to measure the time between the pulses, and calculate to which RPM that time corresponds, than to count the amount of pulses that occur in 1 second. Difference between MCS51 derivatives and AVR. I've worked with both. Both are 8-bit microcontrollers. The main difference is that the AVR is all built to be a speed demon, and a little more logically structured inside. But although AVR used to blow away a standard 8052 derivative a few years ago, it is being caught up rapidly performance-wise by the latest high speed 8052 derivatives (1-clockers). Down side of the AVR is that code takes more room than comparable 8052 code both in the amount of instructions you need to get a particular job done, and in the amount of bytes of object code generated per instruction (about twice as much): your program memory is full before you know it. Also, the AVR is made exclusively by Atmel which means that the continued existence of the AVR is depending directly upon the continues existence of Atmel. Nice is the free IDE package (editor, assembler, simulator, drivers for ISP, and... It's SKINNABLE :o) ), although I find it a bit buggy. To compare AVR and 8052 down to the registers is not very fair, both have their pros and cons. The biggest pro of the AVR used to be speed, but as I said, there are also some amazingly fast 8052 derivatives available today. Remains that the AVR has a marginally cleaner architecture. Altogether I have grown to like the AVR, but the size of the object code remains a point of some concern. A nice 8051 simulator is JSim. It's freeware and it can read in .abs files which you can make with the MetaLink using the $debug directive. http://home.t-online.de/home/Jens.Altmann/ A word of warning: Do not expect a simulator to perform like a real chip! It is not like you can run your entire project inside the simulator. It is a valuable tool for testing the workings of separate routines though. |
Topic | Author | Date |
Error in the program | 01/01/70 00:00 | |
RE: Error in the program | 01/01/70 00:00 | |
RE: Error in the program | 01/01/70 00:00 | |
Simulator | 01/01/70 00:00 | |
RE: Simulator | 01/01/70 00:00 | |
RE: Simulator | 01/01/70 00:00 | |
RE: Simulator | 01/01/70 00:00 | |
RE: Simulator | 01/01/70 00:00 | |
RE: Error in the program | 01/01/70 00:00 | |
RE: Error in the program![]() | 01/01/70 00:00 |