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


Sat Jan 18 2020, 03:45 PM
Eric Jones
Sat Jan 18 2020, 08:49 AM
norsk porno blogg free african dating sites maria halvorsen porno dating naked brianna porno dating ukraine prywatne porno porno dame iselin porno sex porno no eldre porno gratis porno pa youtube stare filmy porno filme porno cu eleve porno foto finsk porno mamyciu porno porno gratis hd porno maroc world dating teen porno free famely porno fjlmy porno dating norwegian women free svensk porno fri porno film porno gay free porno poland porno suomi porno the best harstad porno senior dating sites canal porno norwegian gay porno porno gradis porno deutsch be2 dating porno bi sex drunk mom porno porno porn porno for kvinner bethany joy lenz dating porno folmy porno gay sex gutte porno tee porno nonne porno emma watson dating porno first time anal retro porno pee porno
Sat Jan 18 2020, 07:24 AM
Charles Halfey
Kind Regards,
Tue Jan 14 2020, 07:08 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me
Tue Dec 17 2019, 01:44 PM
hello..i am programming industrial timer using 8051 with 24lc64 eeprom. i have query in storing the 3 diff value in eeprom with enter button. can anyone share c code ?
Tue Dec 17 2019, 10:30 AM
Hello. Can anyone share the code in Bascon and scheme in Proteus?
Thu Nov 21 2019, 12:30 PM
how to interface 8051 microcontroller with NRF24L01+ module
Sat Oct 12 2019, 10:23 PM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 10:18 AM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 07:37 AM
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.



Sat Jan 11 2020, 10:42 AM
Tue Jan 07 2020, 06:53 PM
Tue Jan 07 2020, 12:42 PM
Sun Dec 29 2019, 05:54 AM
Fri Dec 27 2019, 06:14 PM
Sat Dec 14 2019, 12:31 PM
Thu Dec 12 2019, 12:04 PM
Sun Dec 08 2019, 09:16 AM


Guests: 41, Members: 0 ...

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

Members: 38115
Newest member: usb5962
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jan 17 2020, 10:24 PM
We will need the circuit diagram.A Proteus simulat...
Billz Avatar
Posted By Billz
Sat Jan 11 2020, 05:43 PM
hi everyone please attached files are my c code fo...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jan 07 2020, 08:18 PM
Not a stupid question.Setting up "Eclipse" can be...
elt Avatar
Posted By elt
Tue Jan 07 2020, 07:06 PM
So i have just began learning programming micros a...
Billz Avatar
Posted By Billz
Mon Jan 06 2020, 09:22 PM
I think it would be better if you guys try to come...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jan 06 2020, 12:22 AM
Can you post a circuit diagram and any code you ha...
Billz Avatar
Posted By Billz
Sun Jan 05 2020, 08:17 PM
Need help regarding C code (specifically for PIC 1...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Dec 30 2019, 06:42 PM
Can you give more details of your problem.
Rupeshpatil Avatar
Posted By Rupeshpatil
Fri Dec 27 2019, 06:21 PM
How to copy program my old microcontroller to new ...
ilylily07 Avatar
Posted By ilylily07
Thu Dec 12 2019, 02:26 PM
wil do.thank you for your advice!