• Please review our updated Terms and Rules here

PIC general purpose operating system?

NobodyIsHere

Veteran Member
Joined
Dec 21, 2006
Messages
2,410
Hi,

I have been building a simple project using a PIC 16F628 and marveling at how wonderful and powerful these PIC devices are.

My project is a simple serial to parallel converter to allow conversion of a KayPro II keyboard (300 bps serial interface, TTL level signals) to a 8 bit parallel ASCII interface (Intel 8212 compatible) on the Vector Graphic FlashWriter II card. So far, the converter is able to read/write the serial port and pass it on to a terminal and also has the beginnings of the parallel output although presently only the least 2 bits are currently working.

I am wondering if a general purpose 8-bit or 16 bit operating system has ever been written for the PIC. Surely, the device seems capable of it, especially the larger versions (28 and 40 pin chips). Of course, it would interact with the peripherals somewhat differently than a Z80 or 6502 would but in some ways it might even be more simple.

Does anyone know if there is a general purpose OS for the PIC? By general purpose, I mean something like CP/M with a command prompt, interface to peripherals, secondary storage like a floppy drive and/or IDE, etc.

Thanks!

Andrew Lynch
 
It is so funny Andrew...you know...over the past couple of days,
I have been developing an operating system for PIC that just does
what you are asking for :wink:!!! I have tested the beta version, gamma
version, iota version, and now I am finalizing the omega version.

This operating system is

something like CP/M with a command prompt, interface to peripherals, secondary storage like a floppy drive and/or IDE, etc.

but it also does your laundary, shines your shoes, mowes the lawn,
vacuums the rugs, does your finances, takes your pet to the vet,
tells your kids nice stories, cooks (if your wife doesn' mind), and
a whole bunch of other chores :lolsign:. It is very similar to cp/m in
structure, but you can also run programs that are written for Unix,
Xenix, minix. ninix, phoenix, sun, moon, mars, pluto, and alpha
centauri (beta centauri is in the works :workout2:).

If there are other people who are interested in obtaining a copy of
this marvellous OS, please write your reque$t on the back of a
hundred dollar bill with your name, your parent's names, your
siblings, your friends, their family members, a summary of your bio,
their bio, your address, you guessed it... their addresses. Please
write big and legibly, and use as many hundred$ as you wish...:evilgrin5:

Don't PM me please with your comments... I am very emotional...

:biggrin:
 
Well, as luck would have it, I have a very big hundred dollar bill from my gas company.

You can mail out the payment for it while you're posting my new OS

Thank you kindly :)
 
Geez, I musta got the buggy version...

It polished the laundry, washed my shoes, mowed the cat, took the refrigerator to the vet, changed the oil in my vcr, and stewed the lawnmower (it was quite tasty).

Kent
 
Geez, I musta got the buggy version...

It polished the laundry, washed my shoes, mowed the cat, took the refrigerator to the vet, changed the oil in my vcr, and stewed the lawnmower (it was quite tasty).

Kent

:lol: HA HA HA HA !:lol:
 
Now..... a sensible answer! (sorry)
problem with pics it that they have separate program and data memory (harvard architecture), and the program memory is flash (optimised for data retention, rather than re-programmability)

so.. (unless some of the pics allow external program memory) it's not possible to load a program and run it out of data memory, except for using a "boot loader", as on some of the chip families there's a command for programming the flash from ram memory.

It IS possible to run a sort-of interpreted language, and I wrote one for doing fairground lighting patterns, that was quite fun, and the basic stamp uses a basic interpreter, but what you need for running an OS proper is a "von-neumann" architecture microcontroller (such as the (bad example but..) 8031/8051, which is just a microprocessor with (rom), ram, and peripherals all on one chip)
 
Nige, you spoilsport! :-D

As a side note, I've toyed with the idea of self teaching myself (perhaps a group of people with various programming experience) to program a PIC of some sorts. My goal would be to write a simple game similar to the 1970's GI chips: Pong, Tank Wars etc.. perhaps it would even be possible to implement something "modern" like Tetris. We just finished building a Pong kit consisting of a PIC and a handful of supplementary components to generate a video picture, and it struck me that one should be able to copy the concept.

Generally speaking, it is difficult to learn? I suppose there are IDEs, simulators and so on, and one would need a programmer (I have an USB EPROM programmer, which may or may not work). My programming skills are on the level that I'm fluent in 6502 machine code, good at C and several higher level languages, have dabbled or at least have some understanding in how vintage CPUs work internally.

I just need to find the TIME to invest into stuff like this. I already have too many spare time projects that I initiated but never finished. However, I'm not promising an operating system. :-D
 
using a pic for what it's intended for ( i.e. control-type applications) is actually really easy, as long as you are aware of the quirks (things like paging in look-up tables, and the carry flag that doesn't always do as expected). Also it's grown in a similar way to the X86 family, i.e. started off simple & had bits bolted on, some of which don't fit too well. I've had applications where I've spent days trying to get a peripheral to work properly (usually interrupt problems).

Also be aware that any video based application would have to have nearly all the video timing and dot shifting done in software, when you consider that the clock is divided by 4, a 20mhz part is only 5 mips.

I would imagine that pong is far from impossible, but I'd start off with a flashing led, go through e.g. an rs232 terminal & work up from there. and have a google for pic based pongs, I think you'll find people have sweated blood to get there.
 
Hi Nige,
Thanks for the "sensible" reply. :)

There are some RTOS available for PIC

http://www.jasonmcdonald.org/Microchip-PIC-RTOS.htm

Also there is at least a start of an OS for the PIC 18 series

http://www.picos18.com/index_us.htm

Thanks!

Andrew Lynch

PS, I have mostly completed my PIC serial to parallel converter. It can accept input from the KayPro II serial keyboard and output it to 8 parallel data bits (red LEDs) with a 50 mS strobe pulse (yellow LED). The next step is to clean up the source code and then build a parallel port connector at attach it to the Vector Graphic FlashWriter II parallel keyboard input.
 
I would imagine that pong is far from impossible
Yep. I already have a working one, from a Velleman kit. It uses a "16C505 20/P", which I believe is s 20 MHz part but I haven't looked up the other data. Of course I don't know how the video generation is implemented unless it can be reverse engineered in some way. You're probably right that it took a bit of work to write that Pong software, just like it would take quie a lot of effort to program e.g. an Atari 2600 game.
 
Hi Nige,

There are some RTOS available for PIC

ok yes, That's kind of changed my definition of an OS. from something to load, save & maintain programs, to something purely running/scheduling multiple processes (in this case from rom), and I suppose that if you used the "write to program flash" instructions, you could load from external media too.
Just that you couldn't really consider it to be a "soft-centred" system, as "booting" or loading more than a few hundred times, would wear out the flash.

I'd still go for an 8051 type microcontroller for a first go at a system on a chip.

(hey I'm getting old! "System on a Chip" and "Soft-Centred" I was aware of these when they were "buzz words"!)
 
Yep. I already have a working one, from a Velleman kit. It uses a "16C505 20/P", which I believe is s 20 MHz part but I haven't looked up the other data. Of course I don't know how the video generation is implemented unless it can be reverse engineered in some way. You're probably right that it took a bit of work to write that Pong software, just like it would take quie a lot of effort to program e.g. an Atari 2600 game.
-----
Not everyone is aware that the same folks who brought you Pong, Tank Wars etc. also created the PIC back in '76/77. GI originally made them as Peripheral Interface Controllers (PICs) for their I/O-poor CP1600 micro back then and also used them for some of their special-purpose ICs like the CTS-256-AL2 speech processors; after various spin-offs and sales GI Microtech became the Microchip of today, although modern PICs bear little resemblance to the first PIC1640.

BTW, I think I've still got one or two of their game chips somewhere, and a fairly complete set of GI documentation & datasheets from the late 70's if anyone's interested.

mike
 
Back
Top