News:

SMF for DIYStompboxes.com!

Main Menu

MICROHIP

Started by Garrett, November 17, 2005, 04:00:47 PM

Previous topic - Next topic

Garrett

WASUUP,   Anyone ever messed with "MICROCHIP" programming stuff?  I do PLC programming for a living (AB). I found an old "Microchip" box here at work and it had a serial pic programer and two long chip cases full of different microcontrollers(nec,amd,). It also had manuals. I found the latest programming software online and it's free. I am going to persue this and see If I can make a TB switching box using spst switches and dpdt relays just for the hell of it. And maybe combine effects with one footswitch. They are at my disposal for free. So why not.

jrem

I mess with them, the learning curve is steep if you choose assembly.  There is a email list called piclist (www.piclist.com) that you want to be a part of, the emails are generated from an MIT server, the archive is by a guy in CA.

Microchip PIC's rock, for sure, a hell of a lot of power in a $1.50 device.  But they don't drive much other than an LED, you'll need a power transistor to drive a relay.  And, like I said, learning assembly is a long road, but rewarding.  Else there are higher level languages that compile but I haven't used any (well, for the PIC that is).

Another way to go is the PicAxe, www.picaxe.com.   It's like a BasicStamp (www.parallax.com) but 1/20th the price, avail from www.phanderson.com state-side.  They work in tokens instead of compiling assembly code.  If you're new to that world you should start there instead of a full blown chip, unless you've messed with zilog or 8088's, or something before.  The picaxe is cheap and easy and fun.

Garrett

jrem,

thanx for the info.  Very useful.  Picaxe is cheap.  I may order it first.

      thx, garrett

jrem

yes, buy from phanderson, he'll send you instructions and the two resistors.

get a breadboard, make up a serial cable to three pin header.

some other pic projects are at http://jrem.webhop.org/stuff/geek/

open the readme.htm file (I did that instead of index so you can see the size of the files in case you're on a dial up).

Let me know if you want to see pics of the picaxe setup.

regards, John.

Peter Snowberg

When I started messing with PICs in 1992 when there were only four EPROM/OTP devices available, now there are about a zillion different PICs.

I've used them for all sorts of stuff from stepper motor drivers, to fully networked sensing and control nodes with analog and digital I/O and optical fiber networking.

It was an easy sell to clients back in the early 90s because PICs were busy watchdogging the braking controllers in Mercedes anti-lock brakes and they were used somewhere for missile fuse arming/disarming. Highly reliable little chips and the originals (16C5X) were just amazingly hard chips to kill. They're the only microcontrollers that I know of where you could plug them in backwards for 1/2 hour and they still worked fine when flipped into correct orientation.

Some past PIC projects:
- uni-polar stepper motor drivers
- a networked phone line switching system installed in Madison Square Garden
- the robotic camera controllers used to capture the frames that would later be "stitched" together in the first QTVRs
- robotic camera controllers for Boeing, Disney, and others
- I/O interfaces for the Japanese educational market
- interface prototypes for a couple post cardiac surgery pacemaker devices (not implants)
- IR remote controls

Very cool little chips, but these days I'll take Atmel parts hands down over PICs.
Eschew paradigm obfuscation

Garrett

wow, information . 

   I'm sure the communications and programming will be key.  I will probably just use the chips for discrete I/O.



Dave_B

Not sure if it helps, but there's a conversation about getting started with PIC's over here:
http://www.diystompboxes.com/smfforum/index.php?topic=38987

Peter (or anyone who cares to jump in), is there a layman's way of explaining the advantages of Amtel?  I'm guessing the need to bankswitch PIC's is part of it?   :)  As I've mentioned elsewhere, I'm new to these things and I've only used assembler so far, but I can't understand the advantage of designing them with several little banks of memory that I have to keep track of when programming.  One large bank just seems more sensible. 
Help build our Wiki!

Peter Snowberg

Bank switching was sure a BIG motivator, but I like the instruction set MUCH better.

Microchip was an early leader (PICs have been around since the 1970s), but Atmel made faster, more capable chips that ran on less power before Microchip went in that direction. I switched to Scenix parts for a couple of years (like a PIC16C57 equiv. that was rated at 50MHZ and would easily overclock to 75MHz), but dropped dealing with those too. Scenix is now Ubicom.

I wrote a 230.4Kbps communications controller complete with a DPLL that did bit-banging to emulate a Zilog 85C30 SCC (to get IBM's SDLC encoding) using a Scenix SX28 at roughly 50MHZ. The code also contained much of Apple's LocalTalk protocol stack and I2C..... all within 2K(!). That may be the height of my microcontroller gymnastics.

The SX28 only had a couple of changes from a 16C57 apart from the faster speed. It really is an amazing architecture. The whole concept of RISC has been lost as technology advances, but for a bunch of years the Microchip 16C5x parts were king of that hill and they are still found in zillions of products.

I was looking at a hybrid device (dual-slope A/D) in the 1990s that had a bunch of chip caps, printed resistors, and a few IC dies attached to a ceramic substrate. It suddenly hit me that one of the dies was the same PIC die that you can see through the window of the windowed EPROM parts. From that point on I started to notice them EVERYWHERE.

Learn one microcontroller and you're fairly set to know them all. Any knowledge you glean from old Microchip development tools will still be useful and then some. :)

Oh yea, the bank switching was there to allow the core to be narrower. If instructions only have to hold a little address data, they can be trimmed by a couple of bits which translates into LOTS of transistors. The program memory of the early PICs was only 12 bits wide, 8 of which could contain address data.

On the little PICs, I wouldn't use anything but assembler. Parallax made some GREAT tools including an assembler that was full of highly useful macros. I quickly didn't want to code in anything except the Parallax environment. Parallax did the development tools for the Scenix parts and Microchip went ballistic. That was the end of that marriage.

BTW: The parallax environment worked excellently on an old 8086 (!) laptop.
Eschew paradigm obfuscation

jrem

Quote from: Peter Snowberg on November 18, 2005, 01:14:15 PM
Bank switching was sure a BIG motivator, but I like the instruction set MUCH better.

Atmel is French.  I ain't messing with them.  But all kidding aside, once you understand how to bank it's not that big of a deal.  I think the ends justifies the means, so if one is happier with Atmel than PIC or Zilog or Zenix, whatever, IMHO.

Quote
<snip>  Parallax made some GREAT tools including an assembler that was full of highly useful macros.

huh?  Parallax made something other than the token code environment for their BasicStamps?

Quote
BTW: The parallax environment worked excellently on an old 8086 (!) laptop.

Yes, I still use it on an 80C88 Toshiba, but it's for a Stamp.  How do you port the token code into assembly?

The only assembly tool I use is the Microchip integrated development environment (IDE), it fricken' smokes.  Full blown emulator, stack, registers, addresses, all of it, and you can watch it run.  Awesome and a far cry from the TI99 that I learned jmp routines etc on in the 80's.

But I still suggest if one just wants to do descrete I/O they should definitely consider the PicAxe system, much faster learning curve and if you just need tens to a hundred or so lines of basic-style program (which converts to tokens, not assembly, much like the *current* parallax software) then it's the way to go.  And did I mention it's CHEAP?

Dave_B

Not my thread, but I do want to say thanks.  You guys have caught me before I got set in my ways on these chips, which I tend to do.  I'll do some reading on PicAxe and the Amtel this weekend. 


Help build our Wiki!

Peter Snowberg

Quote<snip>  Parallax made some GREAT tools including an assembler that was full of highly useful macros.

huh?  Parallax made something other than the token code environment for their BasicStamps?
Yep!  :D

Before Scenix got going, Parallax made a programmer and a bond-out based emulator for the PIC16C5x series. The emulator allowed you to dump code into the chips without having to use the EPROM testing cycle (erase chip using UV light for 20 minutes, program it, plug it into the target, power up and test, unplug and put back in the eraser, and repeat all day). If you wanted to make lots of little changes you needed to have LOTS of EPROM based parts because you are constantly having to erase them. It was a BIG pain before the Parallax emulator. The emulator was based on the ORIGINAL PIC16C64 which was a bond-out of the 16C57. That number was re-used later for a more capable part. The bond-out chips were not publicly available from Microchip (they were marked "INT USE ONLY") and when Parallax modified their environment for the Scenix chips, Microchip cut their supply off. So much for that. It was a GREAT environment for what it did!!!

The Scenix tools were just as wonderful and MORE. The programmer they came up with was about the size of a stick of chewing gum (a little thicker though) and the Scenix parts have FLASH MEMEORY!!!! None of the Microchip parts did at that time, so testing on the Scenix parts became a snap. It had other cool features like a programmable oscillator too.

I just looked at their web site and they still sell the SX stuff! 8) 8) 8)
http://www.parallax.com/sx/index.asp

Wonderful chips if you need a rocket engine speed CPU in a couple of square centimeters. It's rather wild to me that you can write a program to generate a 25MHz square wave!

Quote
But I still suggest if one just wants to do descrete I/O they should definitely consider the PicAxe system, much faster learning curve and if you just need tens to a hundred or so lines of basic-style program (which converts to tokens, not assembly, much like the *current* parallax software) then it's the way to go.  And did I mention it's CHEAP?
I'll second that.  :icon_cool:

These little BASIC style micros are wonderful, and they cut the learning curve down dramatically! Excellent points.
Eschew paradigm obfuscation

Hal

I found assembly really easy :-D.  HOWEVER, none of my stuff worked.  It all compiled and simulated fine on electronics workbench, but didnt work on the PIC.  I need to get back to it.

Peter Snowberg

Hal, check your oscillator fuse settings. That's it much of the time.  What PIC were you using?
Eschew paradigm obfuscation

Dave_B

The fuse settings got me too.  I was useing a 16f88 and couldn't get anything to work until I unchecked all the fuse boxes in ICProg (the free programming software I use).
Help build our Wiki!

Hal

Quote from: Peter Snowberg on November 19, 2005, 02:18:47 PM
Hal, check your oscillator fuse settings. That's it much of the time.  What PIC were you using?

16f628.  Yes, I was using hte internal oscillator.  I tried burning the program with like...every oscillator setting, using external R/Cs,  a crystal, a cermaic oscillator...etc etc etc etc. 

I bet it was something small and stupid.

jrem

well if your chip programs but doesn't seem to be alive, it could be a few things.  a) maybe it's just not doing what you expect, i.e., stuck in a loop.  b) maybe it isn't getting started.

I have found the internal oscillator to be pretty good.  I've ran an LCD clock off of the 16f628 and it only lost a couple of seconds a day.  Never have a problem with it getting going.

The config settings are most important, though, I set them in the __config word.  Then ICprog pulls in all the right bits, but you must select the right chip prior to hex program load.

If you have something simple I can take a look at it or try and load a chip, email me off line.

Dave_B

Quote from: Hal on November 20, 2005, 02:19:07 AM
I tried burning the program with like...every oscillator setting, using external R/Cs,  a crystal, a cermaic oscillator...etc etc etc etc. 
I bet it was something small and stupid.
Have you tried the simple stuff, like making an LED blink? 
Help build our Wiki!

Hal

Quote from: bellyflop on November 20, 2005, 10:59:17 AM
Quote from: Hal on November 20, 2005, 02:19:07 AM
I tried burning the program with like...every oscillator setting, using external R/Cs,  a crystal, a cermaic oscillator...etc etc etc etc. 
I bet it was something small and stupid.
Have you tried the simple stuff, like making an LED blink? 

yup, that worked :-D.

Then I thought the next simple thing to do was to make a 7-segment "count" sequentially.  That didnt work.  I guess I just need to spend some more time playing around.

Hal

Damn the lack of an edit.

JRem - thanks for the offer!  Unforunitely, all my stuff is at home, and I'm at school.  I doubt I'm gunna have time over thanksgiving, but I'll probably get back to it over december break.  Maybe I'll need the support then :-D.

Cool - I want to do an LCD clock, too.  I have a 4x7-segment that would be perfect for it already.  Pulled it off this treadmil consolse I scored for free.

Dave_B

Quote from: Hal on November 20, 2005, 11:48:56 AM
Then I thought the next simple thing to do was to make a 7-segment "count" sequentially.  That didnt work.  I guess I just need to spend some more time playing around.
Make sure you're wiring it up correctly.  7-segs can be either common cathode or common anode.

My personal path started like this:
  * Make an LED blink
  * Make the entire port blink, Night Rider style.
  * Make the ADC work, displaying the result on the LED's.
  * Make a second channel of the ADC work.
  * etc. etc.
Help build our Wiki!