Question

I would like to write some program or Embedded-C on 8051 MC. Programs like ISR, LED blinking, Round Robin, and all. Is it possible without hardware? Only keil uvision4 hardware simulator is sufficient to write the program? Please help.

Was it helpful?

Solution

The Keil simulator simulates the core and the peripherals and can be used for instruction cycle level timing. It does not simulate the external hardware that you might attach to the device itself. In theory you can attach debug scripts to simulate external devices, but sit is a lot of work.

As far as a blinking LED is concerned the best you will do with the Keil simulator is observe a bit in a GPIO register changing from 0 to 1.

Simulating interrupts is (I believe) simply a case of setting the interrupt flag in the appropriate peripheral.

In short you can probably do it, but it is not much fun and may put you off embedded development altogether.

A Silicon Labs ToolStick starter kit is US$24.99, and comes with the Keil tools and SiLabs' IDE, so that would be a more interesting way to start perhaps. The hardware includes an LED, a switch, a potentiometer, and solder pad access for all I/O pins to extension. If you are a potential business prospect SiLabs often give these out for free.

OTHER TIPS

A simple google search shows many 8051 simulators. Even more educational would be to write your own simulator. the problem with the 8051 architecture is how much things rely on the registers and the regisiter space is different from chip to chip and vendor to vendor, so you can only go so far with just the instruction set.

Likewise there are tons of tools out there from sdcc to other open source assemblers, etc. Pay-for tools are not required. Perhaps desired if you want, but not required.

You can learn 8051 programming for free without hardware.

Simulators can help diagnose many types of coding problems, though I don't know of any 8051 simulator that allows one to easily simulate custom hardware; I wouldn't be surprised if they're out there, though. If one is getting started with microcontrollers, though, I'd suggest that one do at least some work with real circuits. Simulation is all well and good, but it's all animations on a screen. There's something much more compelling about having an actual circuit which blinks a light, generates chirps, or switches some relays, solenoids, motors, or other "real" things.

There are prefabricated development boards and kits available for many controllers, often for under $100. Some of them come with all the stuff needed to do some semi-real-world demos. Others can be readily adapted to do so with about $10 worth of perf-board, wire, and miscellaneous parts along with a cheap soldering iron and even a modicum of skill. It's been ages since I've looked for any inexpensive development kits for an 8051-style controller, but I know some are currently available for things like ARM-based processors, and I would expect there are some 8051 clones which have dev-kits available as well. I think there exist 8051-based PSOC derivatives from Cypress that might be particularly interesting and fun to play with, and the dev kit I bought from them for an earlier USB-based PSOC had a board which included a joystick, LCD, and even a built-in breadboard with included jumper wires, all for under $100.

For Learning purpose, Simulator is Sufficient. but, practically Developing a embedded System needs a hardware for testing.

I had faced same problem when i wrote a bit-banged I2C protocol for 8051 to communicate with EEPROM memory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top