Discussion in "8051 Discussion Forum" started by    Amit Kumar Das    Sep 24, 2010.
Fri Sep 24 2010, 01:28 AM
#1
Is there any easy to use, available RTOS to implement in 8051(AT89S52) ?
Fri Sep 24 2010, 03:06 AM
#2
is RTOS means Real Time Operating System
Fri Sep 24 2010, 07:07 AM
#3
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
#4
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
#5
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
#6
Hai Ajay,Can you brief us more about the "state machine way of coding" and any related articles of study on that.

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

Can you post some example written in Keil C using state machine for S52 microcontrollers.
Mon Sep 27 2010, 09:06 PM
#10
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..
switch(SysState){
case CheckKey:
//check if key pressed or not
//change state here if needed
break;
case ReadRTC:
//read rtc here
//change state here if needed
break;
//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

Information

Powered by e107 Forum System

Conversation

Thu Dec 12 2019, 09:16 PM
enrexzweuz
qdimekzibi
Thu Nov 21 2019, 12:30 PM
raj2555
how to interface 8051 microcontroller with NRF24L01+ module
ExperimenterUK
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
Nathaniel
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.
Wed Sep 18 2019, 08:48 PM
Caryn Kover
Thank you for your time,
ExperimenterUK
Mon Aug 05 2019, 07:09 PM
@Ismail ..post in forum, give details
Mon Aug 05 2019, 04:33 PM
Ismail balghmi
Hello. Please I won't download
ExperimenterUK
Wed Jul 24 2019, 12:47 AM
@BUSTER123 Please post in the forum
Tue Jul 23 2019, 06:13 PM
BUSTER123
hello! newbie here. i am kind of a guy who hates using ready - made existing libraries, so this helped a lot as i was trying to control and write to a character lcd display. however, i can't figure out how to set the cursor position. for example, i want to set it to the 5th column in the first row, so position 5. so according to the table, i am sending 10000101 on the 8 data lines of the lcd (register select pulled low). the cursor does not move there however. and i cant move the cursor left or right too. is it something wrong that i am doing? thank you.

Downloads

Comments

Istika
Thu Dec 12 2019, 12:04 PM
nabiha_anaya
Sun Dec 08 2019, 09:16 AM
ananyagupta
Tue Dec 03 2019, 07:53 AM
wells
Mon Nov 25 2019, 08:25 PM
auwal
Tue Nov 19 2019, 03:13 PM
ANKITPATEL
Mon Nov 18 2019, 11:00 AM
Casmir
Wed Nov 13 2019, 06:25 AM
DeepakBGattani
Mon Nov 11 2019, 01:31 PM

Online

Guests: 48, Members: 0 ...

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

Members: 38109
Newest member: Istika
Forum Activity
ilylily07 Avatar
Posted By ilylily07
Thu Dec 12 2019, 02:26 PM
wil do.thank you for your advice!
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Dec 12 2019, 07:13 AM
Something like this ?https://www.bing.com/videos/s...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Dec 12 2019, 06:58 AM
The layout is a bit different, but it is the same ...
ilylily07 Avatar
Posted By ilylily07
Thu Dec 12 2019, 04:38 AM
https://i.imgur.com/6S5FcwF.png right now im follo...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Dec 10 2019, 04:49 PM
ilylily07 Avatar
Posted By ilylily07
Sun Dec 08 2019, 01:24 PM
Hi .im humbly ask for your advice as i wrongly pur...
nabiha_anaya Avatar
Posted By nabiha_anaya
Sun Dec 08 2019, 09:19 AM
My teacher assign me a project on "voice control h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Nov 29 2019, 04:24 AM
" Is it possible to interface a fingerprint scanne...
ilylily07 Avatar
Posted By ilylily07
Thu Nov 28 2019, 03:50 PM
You will not find any code for an 8051 as no one w...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Nov 26 2019, 05:44 PM
You will not find any code for an 8051 as no one w...