--0__=80256AA30044E7078f9e8a93df938690918c80256AA30044E707 Content-type: text/plain; charset=us-ascii Hi, " If you want to learn about RTOS, a good book is "MicroC/OS-II, The Real-Time Kernel" by Jean Labrosse. www.micrium.com Highly recommended and I'm in no way connected to Jean Labrosse or Micrium ;-) " I am not connected to Labrosse, either, but his book concerning "Embedded System Building Blocks" (not the precise title) is also well worth a read if you wish to learn about drivers and basic issues/techniques regarding embedded work. It also has full source code to support the text. Regards, Dan (Embedded Peter Tiang @MITVMA.MIT.EDU> image moved 09/08/2001 13:27 to file: pic08419.pcx) Please respond to pic microcontroller discussion list Sent by: pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: Re: [EE]:Embedded system ,RTOS Security Level:? Internal > Hi, > > Good afternoon. i have several issues that i am in > doubt. > > 1. what is embedded system? what is the difference > between a normal electronic system with a uC, with an > embedded system? Here's a definition of embedded system: http://www.mitre.org/research/y2k/faq/embedded.html#1 > 2. i am used to programming pic16F84 and 68hc11. the > procedure is like this. key in the assembly in an > editor, them assemble them to hex file, then download > them to the uC. that's it. the uC can be brought > everywhere and still function the same. > > My question is, why people are telling me that i need > a RTOS ( Real Time Operating System ) to develop an > embedded system? They are telling me that drivers need > to be written, so on and so forth. Why? > What role does the RTOS play? What you have been programming all along is what's call the "foreground/background" or "superloop" system. That is, an application in an infinite loop calling different modules/functions to perform a desired operation in the "background" Occasionally it is "interrupt"ed to perform some critical task in the "foreground". These are your interrupt subroutines. This system works fine for most application. Biggest drawback is that modules/functions in the "superloop" does not get it's share of CPU time at a constant rate, or to put in RTOS-speak, it is in a non-deterministic manner. The rate that your function gets executed depends on the time taken by other modules/function calls in the loop. This becomes a problem when your "background" system or "superloop" gets increasingly complicated with more and more modules. When system that previously works fine, but no longer works when new code is added to the "superloop". How then can you ensure that a function IS executed, say every 10 millisecond. Task/function response time will be "non-deterministic" in your current system, because you have to go thru the all modules in the "superloop" before it gets to your function. Best example is a system where you enter a key, but sometimes, nothing happens until a certain time later. Sometime fast, sometime slow. This is one side-effect of non-deterministic system. You probably can use a timer interrupt to perform this task. But what if you have more and more functions that need to be executed every, say 5ms, 50ms, 1s, 1 hour, 1 day etc. This is where a RTOS comes in. With an RTOS, every task/module/function is given a share of CPU time at a predetermined rate and prioritized according to a predetermined task priority. This ensures that the highest priority task gets executed as quick as possible by the CPU and thus improves and optimises overall system responsiveness. This means that a task that is just waiting for an event (such as keypress) can give up CPU time to other more important task, instead of hogging CPU time in a polling loop. > i don't get it, cause i am still looking things at the > binary level. You will, once you start working on bigger and more complex systems, when even assembly coding will no longer do. You'll most probably need to move on to higher-level language such as C. > 3. Another issue is the driver issue. When someone > told me that driver need to be written for certain > embedded component, i start to go blank. how should i > start? > Another senior engineer told me that i have actually > been writing drivers without knowing it. really? A driver is just a piece of code that you write to make certain piece of harware function. Say you have an external EEPROM, the code you write to interface with that EEPROM is the driver. > > Can anyone please enlighten me? > > thanks a lot > Hope the explanation helps. If you want to learn about RTOS, a good book is "MicroC/OS-II, The Real-Time Kernel" by Jean Labrosse. www.micrium.com Highly recommended and I'm in no way connected to Jean Labrosse or Micrium ;-) Regards, Peter Tiang -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu --0__=80256AA30044E7078f9e8a93df938690918c80256AA30044E707 Content-type: application/octet-stream; name="pic08419.pcx" Content-Disposition: attachment; filename="pic08419.pcx" Content-transfer-encoding: base64 CgUBCAAAAABBADEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAABQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA= --0__=80256AA30044E7078f9e8a93df938690918c80256AA30044E707-- -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu