Discussion in "8051 Discussion Forum" started by    Amit Kumar Das    Sep 24, 2010.
Fri Sep 24 2010, 01:28 AM
Is there any easy to use, available RTOS to implement in 8051(AT89S52) ?
Fri Sep 24 2010, 03:06 AM
is RTOS means Real Time Operating System
Fri Sep 24 2010, 07:07 AM
Ya I think RTxtiny .I dont have keil installed,you can check in that help topics you will find it there . Or google free rtos you will get it at free rtos site .
Fri Sep 24 2010, 07:12 PM
its hard to use a kernel in 8051. 8051 is too small for a kernel type system.
I suggest to use state machine way of coding for best and faster working applications. you can also write state machines to mock multitasking
Fri Sep 24 2010, 11:58 PM
Is there any state machine software (with documentation and example) available for 8051 which can be interfaced to keil like QDK ?
Sat Sep 25 2010, 04:58 AM
Hai Ajay,Can you brief us more about the "state machine way of coding" and any related articles of study on that.

Sat Sep 25 2010, 10:03 PM
Read the txt file regarding state machine.
Sat Sep 25 2010, 10:10 PM
Sorry the attachment was not attached due to error.
Sat Sep 25 2010, 10:13 PM
Ajay Sir,

Can you post some example written in Keil C using state machine for S52 microcontrollers.
Mon Sep 27 2010, 09:06 PM
Its simple to implement, I will see if i can make a working example to put up on forum but for now just understand the logic.

You will have a variable that will hold the state of system.. say SysState. and there are few states depending on tasks your system is going to do..
simple example:
A task for keypad, LCD and an RTC.
Task1: Check for key and show time stamp on LCD when key is pressed
Task 2: Update Datetime on LCD
Task 3: process interrupted event (make a GPIO high/Low)

Possible SysStates:
A> Check key
B> Key Detected
C> Read RTC
D> Update LCD
E> Event Process

then a simple switch case statement in while(1) loop does the job..
case CheckKey:
//check if key pressed or not
//change state here if needed
case ReadRTC:
//read rtc here
//change state here if needed
//and so on...

Remember its always recommended not to spend too much time in ISR, coz you may miss other interrupts or interrupts may get delayed for a longer time. so State machine approach gives us this facility not to spend too much time rather you can simply change the state of your system to Interrupt.. and process that interrupt in main loop.

There is no/very less while loops in state machines, simple if conditions so that state machine is always in running mode never stops.

you can make use of multiple statemachines to mock up multitasking..

lets say
State machine 1: SystemState (Task1, Task2, Task3)
State machine 2: TaskState (Tas1state, Task2State, Task3State)
then each task1state may have sub states..

so whenever system state changes to a new task, you processor without a need of context switch starts executing code for it. for changing systems state you can make use of a timer which is fired at a fixed interval of time.

Hope you get an idea now
 Amit Kumar Das like this.
Tags state machine embedded system8051 state machine codingmultitasking through state machines

Get Social


Powered by e107 Forum System


Fri Aug 07 2020, 08:01 AM
Tony Eldredge
{{Are You interested|Interested|Would you be interested} in {advertising|an advertising service} that {costs|charges} less than {$50|$40|$49|$39} {per month|monthly|every month} and {delivers|sends} {hundreds|thousands|tons} of people who are ready to buy directly to your website? {Check out|Visit|Have a look at|For details visit}: http://www.getwebsitevisitors.xyz |{Looking for fresh buyers?|Want more visitors for your website?|Do you want more people to visit your website?} {Get|Receive} {hundreds|thousands|tons} {of people who are ready to buy sent directly to your website|of keyword targeted visitors directly to your site}. {Boost your profits|Boost revenues} {fast|quick|super fast}. Start seeing results in as little as 48 hours. {For more info|To get details|For additional information|To get info} {Check out|Visit|Have a look at}: http://www.getwebsitevisitors.xyz
Thu Jun 11 2020, 06:27 AM
sir could please send the code for I2C and wifi interfacing with 8051
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Sir kindly send the code file i2c for 8051
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
how can get hadwere of this project
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 10:12 AM
Pearl Olin



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 108, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123
Forum Activity
liqian Avatar
Posted By liqian
Fri Aug 07 2020, 03:31 AM
I found the part on here https://www.jotrin.com/pr...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 11:07 PM
PS: I am a new learner thats why my question may s...
Mirza123 Avatar
Posted By Mirza123
Wed Jul 01 2020, 02:05 PM
Thanks for the assistance. I have read the data sh...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 10:12 AM
See section 15 (Ports) of the data sheet. ...
wimac Avatar
Posted By wimac
Tue Jun 30 2020, 10:05 AM
How did you know that it is not 8051. Mirza123It i...
Mirza123 Avatar
Posted By Mirza123
Tue Jun 30 2020, 08:39 AM
It seems ports on the AT89LP2052 is not like on th...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 30 2020, 08:34 AM
It seems ports on the AT89LP2052 are not like on t...
Mirza123 Avatar
Posted By Mirza123
Thu Jun 25 2020, 04:07 PM
Hello!i am trying to use AT89LP2052 ( AT89LP2052 h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jun 17 2020, 09:42 PM
It is about capacitor? i should put it between Vcc...
cerouno Avatar
Posted By cerouno
Wed Jun 17 2020, 10:37 AM
Take another look at the power supply to the LCD.A...