PIC Microcontroller discussion

Hello sci.engr.mech users,

No question here, just a general topic for you to discuss...

I'm finishing up my senior project in mech engr and I just wanted to see if anyone here works with or is interested in electronic controls.

We haven't actually tested anything yet, but our design uses a PIC microcontroller (18F452) to read sensors, take input from buttons and turn on relays. If you have done anything similar to this, please post a reply. (Don't worry, it's far too late in the semester for me to steal any of your ideas.) Oh, for programming, we purchases PIC Basic Pro (from MElabs)... it's very simple, but sometimes I question that accuracy with which it compiles code into assembly.

One question: We would like to be able to have some data acquisition capability through RS232. We've got the chip set up for output, and we know how to code the commands for output... but what are some good computer programs for receiving this data output? I would like to output the voltage that the A/D converters read. Sometimes the chip behaves strangely and I really have no way of seeing what it sees, other than using a volt meter.

It seems to me that PICs are really intended for robotics hobbyists... I haven't heard much about industrial applications for these. My main concern right now is the reliability of these things. From my experience, these chips can be pretty flakey. (No pun intended) However, they are very very cheap compared to PLCs, and I was wondering why they're not replacing them. Maybe there are differences and advantages that I do not know about.

Sorry for such a long post! I just haven't seen much discussion about this and thought that some of you might be interested. Soon I'll be documenting our work and putting together beginner's howto manual for controlling projects with PICs. Let me know of any recommendations you have... I'll make the howto available on the web soon.

-matt

Reply to
matt.f
Loading thread data ...

PICs are cheaper than 555s, so they're everywhere, including flashing the LEDs in kid's sneakers.

I don't want to say they're flaky. My experience with the 16C72 says they can do one thing pretty fast and pretty well. Asking them to do multiple things may tax their abilities and uncover strange glitches, especially if you're trying to multitask with interrupts. In your case, if the chip is just polling inputs and whacking outputs in a single simple code loop, it will probably be okay.

I used to run a timer interrupt continuously and bit- bang a 1200 baud RS232 stream of information, pin- selectable to be memory dumps, input readings, calculation results, whatever. I had the PIC put in a every once in a while, so you could read it on a terminal or connect it direct to a serial printer or snag it with a comm program. You could have it send lines with fields separated by commas, and plug the capture file into a spreadsheet if you like.

PICs haven't replaced PLCs because PLC users don't think like programmers, and aren't interested in learning BASIC, much less assembler.

-Mike-

Reply to
Mike Halloran

PICs are very reliable--it is the programming that may be suspect. I recently completed a work project that uses a PIC for its "brain". It is a critical care medical device used as part of a heart-lung machine during open heart surgery. If the PIC were not reliable it definitely would not be used for such a critical application.

PIC is one type of microcontroller (mcu). PLCs use microcontrollers, along with other electronic components that create the PLC module. A lot of PLCs are based on 16-bit mcu chips. Some of the more common (mcu used in PLCs) are from Siemens, Philips, Mitsubishi. PLCs are designed for industrial applications such as process control, factory automation, etc. and are much easier to get up and running than a mcu. MCU is better designed for "embedded" systems such as consumer products, medical devices, automobiles, etc. and "real-time" applications. MCU require additional electronics such as glue logic, oscillator/crystal, etc. PLCs are ready to go out of the box, depending on the module(s) you get.

You may want to join the PICLIST to get more information about PICs. Look up info for the particular PLC you are interested in (Allen-Bradley is very popular in USA).

Microcontrollers and PLCs are both indispensable--but for different applications.

Reply to
ms

Well, OF COURSE the programming is suspect; _I_ did it. I've never written a bug- free program in my life. In recent years, I've gotten worse at finding bugs, or better at hiding them, but I'm sure they're still there. ;-)

That you used a PIC in a medical device does not prove or disprove anything about the PIC's reliability. Your use of quotes around the word "brain" suggests that the PIC wasn't required to do anything particularly taxing. Which of the particular chip's capabilities did you use in the product? Simultaneously?

Agreed that PLCs and PICs are different devices entirely.

-Mike-

Reply to
Mike Halloran

Mike, Sorry, did not mean to imply that "your" code was suspect, just that hardware in general is more robust than software. In fact, when performing an FMEA software is "assumed to fail" (from FDA guidance for FMEA). When there are "bugs" in the hardware it is usually identified by errata supplied by the manufacturer. Microchip has generally been pretty good about supplying errata sheets in a timely manner. Software bugs may be significantly more difficult to track down.

As far as complexity, the device I worked on was not extremely complex: a dozen sensors, some output control lines, a character LCD, some redundant safety systems. We did use all I/O available for the device (approx 40 if memory serves correctly, some multiplexed), as well as A/D conversion, two timers, watchdog, in-circuit serial programming--all the usual stuff. About the only thing that runs "simultaneously" are the timer modules and watchdog in hardware. An "operating system" was not used.

PICs are nice little inexpensive devices about 2 orders of magnitude less expensive than PLCs. MCU vs PLC--it all depends upon the application.

Reply to
ms

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.