PIC control board PCB

sorry for being gone for so long getting my skills up
but let me see if i got this straight the 4620 PIC is basically better than atom and a stamp also can this processor be used on a bot board as well
(i was wandering that) and i would have more memory for programming
and if not what could i use for memory and multitasking
if this were asked sorry oh also i got my ssc32 and bot board :smiley:

Dude, you need to locate the punctuation and shift keys on your keyboard… :smiley:

“Better” depends on where you’re coming from and where you’re going.
The 18F4620 is faster, has more memory, and has more I/O options than a Stamp.
NO, it cannot be used on a Bot Board. It CAN generally be used on any board that uses a PIC 18F-series with 40 pins (because the pinout will be essentially the same).
Multitasking is generally a software issue. Many MPUs can be used to run multiple tasks - the difference is mostly in how fast and efficiently they can do it.

Pete

Sorry about that.
Well ok what could I use to run the bot board
that has the same or more speed and memory,
also could you explain multitsking?
(My skills were on mechanical designs and a little programming though I still got a lot to learn.)again sorry for the grammor errors.

I don’t have any experience with the Bot Board, so I can’t help much with that. I’m guessing it uses a Stamp, so there’s only a couple of things that will plug into it.

Here’s my personal definition of multitasking:
It means one CPU that appears to be doing more than one thing at a time.
As an example, on your Windows PC, you can be downloading a file from the web, and at the same time you can be playing Solitaire. That’s multitasking.
HOWEVER, note that the CPU is really only doing one thing at a time. But it is switching back and forth between the ‘tasks’ so fast that it appears to be doing more than one task at a time.
So on a small MCU like a PIC, if you want multitasking, you must write code that causes it to spend some time on one task, then ‘save your work’ and switch over to working on another task, etc.
On a small MCU, a simple version of multitasking is when you have a Main Program, and you also have an Interrupt Handler. That is, you normally are running Main, but periodically something causes an interrupt, so your MPU goes and does the interrupt-handling code for awhile. Perhaps the interrupt comes from a timer, and happens every 10 mS (100 times per second). To us humans, the MPU appears to be doing 2 things at once.

The major computer OS’s (Windows, Mac OS, Linux, UNIX, etc.) all do multitasking, more or less. A really good implementation of multitasking is in VMS. You young guys probably haven’t heard of it, but VMS is one of the best OS’s ever made. VMS is also the standard for “clustering”.

Meanwhile, there is also something called “multiprocessing”. This means that you actually have more than one CPU running at the same time. My new board (the subject of this thread) has two PICs, so it can really do 2 things at once. And since each of the PICs can multi-task, that means that the board can easily be working on 4 things at once (or more).

Pete

The Mini Atom Bot Board can use any Basic STAMP 2 compatible MPU, Basic ATOM or ATOM PRO 24/28 pin compatible MPU, or similar as long as the pin configuration matches. I have a Basic ATOM 28 pin MPU on the ABB now, running my Octobot Rover. The ATOM PRO is much faster than the ATOM, but most ATOM software needs minor to major modification to run on the PRO.

8-Dale

BTW, before somebody asks “can we run VMS on a PIC?”… the answer is (unfortunately) “no”.
VMS (today known as “OpenVMS”) runs on Itanium, Alpha, and VAX.
VAX systems have been obsolete for years.
Alphas are still available (I think), but are being phased out.
[Trivia: When it was new, the Alpha was the fastest microprocessor you could buy.]

Pete

Basic Atom 24, Basic Atom 28, Basic Atom Pro 24, Basic Atom Pro 28, BS2, BS2-E, BS2-SX, BS2-P, BS2-PE, BS2-PX, Javelin Stamp, Basic-X24-P, Oopic-R, CB220, ZX-24, ZX-24a… There may be more, but I got tired after finding 16 :smiley:

This got me thinking, can a PIC run an operating system? I mean a dsPIC running at 120 Mhz has got to have more computing power than a 286. The 16/32-bit ness might be the killer here, though I know Linux and other OSes can technically run under 16-bit.

I did a breif search and currently there is no dsPIC Linux or Unix-like port I could find. Honestly, I think the answer is a PIC could run a true OS but it would use too much system resources to be impracticle. If one needed a bunch of programs, some kind of more advanced bootloader (like I described earlier) would probably be better.

However, in my search I did find some nice C30 gcc ports for compiling dsPIC code and programming under Linux. forum.microchip.com/tm.aspx?m=94243 I’m not going to try that first, even though it would be nice not to have to use windows. However, after I learn some basics and get things running smoothly in Windows, I might be able to do things wholly in Linux. I wonder if KDevelop will have a PIC build environment in the near future?

I think the main problem would a lack of RAM. The dsPIC that I’m using has 2KB I think. That’s pretty good when you don’t have any OS overhead, but not much for a ‘standard’ type of OS.
To use most OSs, you would also want to have a large external address space.
A ‘microcontroller’ just isn’t intended for running general-purpose OSs.

Another way to look at it:
If you could run a “real OS” on a PIC, what would you expect it to do for you? You’d probably want mass storage, but where would you hook it up? It would probably have to be serial. Your only good display option would be a serial port - no graphics, no mouse. By the time you installed drivers for these types of peripherals, you wouldn’t have much program space left…

A 3rd way to look at things:
The code that I’m writing for my board is an OS, more or less. It’s just not “standard” - it won’t run Windows, or vi, etc. It will be an OS for controlling certain robot-oriented gadgets.
OK, it’s decided: I’ll call it “PetePICOS” :laughing:
Or how about “Pete-PICed-a-peck-of-pickled-peppers”.
Another of my favs is “PIC Me!”.

Pete

Thanks for the info guys.

Could use an MMC/SD card and your SPI port. Those are nice and small too, esp. if you get the RS ones. :wink:

Today I mounted the new ‘brain’ on my bot, and made up cables to connect the brain to power, the sensor board, the SSC-32, and the motor-control board.

I’ll post a picture later.

Pete

I posted a picture at:
www.geocities.com/saipan59/robots/rear.jpg
This view is looking at his rear-end.
The new PIC brain is on the back end, with a serial cable plugged into it. The other cable laying on the table plugs into the ICD2 programmer.
Directly forward of the brain is the SSC-32 (it’s not really visible).
Above the SSC is my sensor board from a few months ago. The empty space will be for things like a voice-recorder chip.
I took off the two back legs since he has wheels now. I’ll find another use for the back legs and their servos.

Pete

Hey, Pete.
I just got a free moment and figured that I’d update you guys on what I’ve done (or the lack thereof) with the dual PIC board.

So far, I’ve assembled the board, assembled board for a (not perfectly working) speakjet and (properly working) robot ear circuit.
I wrote a quick C program to try to speak to the speakjet, with no avail (I’m pretty sure I messed up the baud rate).
So, I went to school and tested the bugger with one of their nice scopes.
Sure enough, I was sending 4X as fast as I should, because I forgot that PLL is not factored into the OSC speed.

That would have been good news (because it would have been easy to fix) if I hadn’t just then accidently bumped the 12V battery ontop of it.

ZZZZZZZZZZIIITTTTTT KKKKKKLAAAAAAACCCCKKKKKK!
:stuck_out_tongue:OOF:

So, I managed to toast (literally) the 18F and irrevocably (but non-externally) damage the dsPIC.
Afterwords measured the resistance of the two chips, through their power pins, and the 18F was circa 50 ohms and the dsPIC was circa 200 ohms.
Very roasted.
:stuck_out_tongue:

I have replacement chips (I know myself very well ;P), but I’ve gotten distracted in the interim and haven’t done anything further.

By the way…
Your quadrepod/rover looks really creepy with those arms sticking out the front.
Nice job!
:slight_smile:

I wouldn’t necessarily call the dsPIC bad. Measuring resistance doesn’t mean much, unless you compare it with an identical known-good part measured in the same way with the same meter. This is because the semiconductor devices behave differently according to the voltage, polarity, etc.
You could try powering it up (with normal voltages :wink: ) and check the following:

  1. How much current does it draw?
  2. If the current is not abnormal, hook up your programmer and see if it is happy with it.

Pete

If you are using low voltage capacitors, something less than 10V like 6.3V or 4V you should consider they may have died. Tantalum capacitors in particular like to die to low ohm resistances from a few ohms to a few hundered depending on how badly they are abused.

I just uploaded new code to:
www.geocities.com/saipan59/robots/dualpic.zip
It’s code for both the 4620 and the dsPIC, version V0.2.
A lot of good stuff is working:

The 4620 talks I2C to my sensor board, motor control board, and the dsPIC.
The dsPIC talks to the SSC-32, using commands sent from the 4620.
The dsPIC can be told to output data on its 2nd serial port (but I haven’t actually tested it).
The dsPIC can be told to make A/D readings from any of the 9 input channels (the 4620 can also do A/D stuff on some pins, but I haven’t set that up yet).

Pete

It’s all getting better and better! :slight_smile:

I just checked Microchip, and my second order has shipped which I should get around Nov 30th.

If anyone needs 4620’s and dsPIC4011’s for your boards, I will give away two each of mine when I get them. I plan to use mostly the 4680 and dsPIC 4012 or 4013 for my boards after I build a board stock and have it working. I am also getting a 4685, but it was backordered.

8-Dale

I have my eye on this OOBOT40-3 Robot Control Computer as a possible carrier for PICs. It is supposed to be able to use 40 pin PICs also and the ooPic it comes with is based on an 18F PIC.

8-Dale

A parts list of what you actually use to build your board would be helpful. :slight_smile:

I’ve put together the following so far, but have not yet combined everything by component value or looked at the other images for additional information. I took the following from the schematics.

Dual PIC Power System

D1 - D4 1N4001
C2,C3 470 uF
U2 LM317
C1,C4,C5,C6 10uF
U1 LM2940
R1 10 Ohm
D5,D6 1N5817
C2a 22 uF
C2 470 uF
R2,R3 4.7k
R4,R6,R8 10k
R5,R7,R9 100k
Q1-Q3 2N3904
U3 TC4626
C7 0.1 uF
Q4-Q7 Standard n-Channel MosFET
P1
P2

MPUs

D7,D8 1N4148
R10,R13 10k
C10,C11,C15,C16 33pF
X1 10 Mhz
C8,C9,C12-C14
R11,R12 4.7k
X2 7.3728 Mhz
U PIC18F4620
U dsPIC30F4011

I/O

J1 DB9 Socket
P5
C17,C19-C21,C23 0.1uF
P6
R14 1 Meg
U MAX232
U MC1455
U TLP434A
C22 1uF
P7,P8
P9,P10
JP4,Jp5

<EDITED: Corrected part LM2940 and removed SW1-SW4>
8-Dale