Implementation of a multi-threading package in C language and some test-cases.
You need Edsim51 to simulate 8051 processor and SDCC to generate Edsim51-targeted files.
-
Edsim51
- From http://edsim51.com/
- Runs as a Java app
- DI version simulates a complete embedded system
- LCD, LEDs, keypad, bank of buttons, ADC, DAC
- cycle-accurate processor
-
SDCC for Edsim51
- From http://sdcc.sourceforge.net/
- SDCC: Small Device C Compiler
- Open source, free, cross-platform
ppc stands for programming project checkpoint.
- ppc 1: cooperative thread-switching
- ppc 2: preemptive thread-switching
- ppc 3: semaphore + bounded-buffer example
- ppc 4: two producers and one consumer example
- ppc 5: delay function + parking lot example
Each ppc is based on the previous one.
-
In each ppc directory, use
make
command to generate.hex
file.The warning 85 can be ignored.
-
Click Load in Edsim51 simulator and select the generated
.hex
file. -
Click Assm.
-
Now you can click Run to execute or Step to execute by one step.
You can modify the Update Freq. to change the execution speed.
-
If you modify the source code, then you need to use
make clean
to remove old.hex
file and re-generate.
Feel free to email me at khchen.me@gmail.com or open an issue here if you have any ideas.