[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Microcontroller thread goyim What are you working on? I'm

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 6
Thread images: 2

File: avr-icon-480x280.jpg (25KB, 480x280px) Image search: [Google]
avr-icon-480x280.jpg
25KB, 480x280px
Microcontroller thread goyim
What are you working on?

I'm planning on writing a small RTOS for my AVRs. Currently lost on, how
>>
Doing a clock on an 8bit pic micro
>>
>>61483511
I was making a HUD, but I got bored.
I need to buy like 6 different components that are worth like 10ยข/ea to finish it, but don't want to spend $10 in shipping to get them.
>>
>>61483511
The Ben Heck videos weren't happening enough for a hip guy like yourself?
>>
>>61483511
A real-time operating system is practically just a scheduler. Which AVR are you using?
>>
File: 1426550899217.jpg (326KB, 1920x1200px) Image search: [Google]
1426550899217.jpg
326KB, 1920x1200px
>>61483511

I've already done this and it runs on all atmega uconts. Here are the basics in the order you should develop them.

1. Interrupt based Serial library for debugging purposes using a terminal. You can really speed up development with this. Sure, you can get up and running faster and do all your debugging with an IDE that supports JTAG, etc, but being able to write debug statements out a UART directly from breakpoints in the code will save you time in the long run, as they can express complex states and multiple variables at one time. Doing this in an IDE requires too much navigation and thinking about what the combination of X, Y, and Z means at any one time.

2. You need a library to keep track of milliseconds and to handle sleep/delays in the main function loop that still allows ISR calls to run freely. This library should take into account the clock frequency and be easily configurable if you want this OS to be at all portable.

3. Make a debugging library that piggy backs on 1 and 2 to give every debug statement a time stamp.

That will get you started. The rest is highly dependent on what you want it to do. An RTOS "guarantees" a certain task completes in a defined amount of time. This requires careful programming and testing of all routines. Make sure your ISRs do not touch any external state machines -- ISRs service hardware and input/output data, that's it, all other logic belongs elsewhere -- it's more work to think out the code doing things this way, but will save a lot of headaches when your code base gets swoll.

Assembly may be required for computationally intense actions, but usually it is not -- it's more important that you can map out exactly how much time every routine takes. This should be straight forward once you get your debugging library up and running.

Also, if you write your own serial library, you will may to write your own CLI, if you want a CLI.
Thread posts: 6
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.