??? 02/09/07 10:48 Read: times |
#132342 - KISS, and one step at a time Responding to: ???'s previous message |
Mike Stegmaier said:
After everyone's comments and my ideas, I think it is now time for me to create a new plan for my 8051 system/programmer combo.
What I will do is attach the crystal to the microcontroller the way it is supposed to be attached (to X1 and X2 on the micro), and maybe I will ground X1 and X2 through 33pF capacitors. Then I can guarantee a working clock. I would get rid of the "maybe" and ground X1 and X2 through 33pF caps as indicated in the relevant datasheets. Then I can connect the parallel port to port 1 pins and 2 control pins from the parallel port to INT0' and INT1'. I can write the code, BUT here's the catch. The code must be hardwired. The reason for that is because the code must run, even if the rom is not programmed (example: a new chip has beem put in). What do you mean by hardwired? A rom is looks fairly "hard-wired" to me. I know for a fact that I need a set of buffers (74HC245 will work) between the hardwired section and the data lines, so that it wont interfere when data is read from the EEPROM or RAM. I know that I need to use some address lines as inputs. Here is where problems come in: Rather than me manually writing out the codes for each instruction on paper, and manually decoding it, I want to automate the whole thing. As stated by others, that's the purpose of a (cross-)assembler. No need to invent anything new here. As for converting a script to the correct byte codes (the codes that you see in an EXE file for example), I can easily do that. Now converting the byte codes to a simplified requires boolean algebra knowledge. I can do it by hand, but I would rather see that software can do it instead. I would say knowledge of boolean algebra is a prerequisite for programming in general, and certainly for embedded systems/microcontrollers.. Why? because I want to avoid wasting two months or more on creating the optimal circuit. Pardon my french.. but using an ISP-programmable part would have gotten you "on track" somewhere half-way last year... see http://www.8052.com/forum/read.phtml?id=117231 The easiest way out is to use a bunch of "and" gates and inverters, but if I can avoid that, I will be happier. So I see that I need to perform boolean algebra. I can write many programs in Quick Basic and PHP. so if someone can give me a basic idea in an easy mathematical sense on how the laws of boolean algebra work, then maybe I can figure the rest out. So in other words, I want to make a hardware based rom that supplies code to the data lines based on a fixed address. That is what a ROM does. You can replace ROM by EPROM, EAROM, EEROM, FLASH.... whatever device will keep it's data on power loss... You could even consider a battery backed SRAM. As for the code, it may vary depending on the number of gates required. I am willing to add a few "nops" in my code if it makes the logic alot easier. Please help me on this. Thanks. What you actually want to acheive is something that is easily (re-)programmable from a PC, using the paralell port as interface. Why not use a SRAM chip (6264 or others) that you write to using the lpt port, and then by means of a switch, map the SRAM into the address space of the 8051, issue a reset, and run your code from SRAM? or just build something like: http://www.pjrc.com/tech/8051...dware.html Once you get more proficient in assembler _and_ boolean algebra/logic, only then try somthing that's more difficult. Problem with what you are trying to accomplish is that if it does not work, you will have a hard time figuring out what is wrong... Is it your PC-software? your parallel port usage? your hardware? your 8051 assembler program? You will have nothing to run a "sanity check", lacking a running 8052 system to do some experimenting on... I am not saying that what you want to do is impossible, but I am saying that for you (and for me) it would be a lengthy process, probably ending with a big disappointment... |