Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

RS485 communications interface with PIC

Status
Not open for further replies.

djroseman

Electrical
Jul 11, 2002
23
GB
Hi all,

First off, if this is in the wrong place, then please let me know.

I am very new to PIC programming, but I do know a little about writing embedded software in C and assembler. I have been asked to design an interface to send status information over an RS485 link for a power supply application, but I know nothing about what tools I need for development, or to implement the application

Can anyone help get me started?

My initial research seemed to show that I may need something like a PIC16F628, is this approporiate for what I want to do?

Regards
Dave Roseman
 
Replies continue below

Recommended for you

Google pic rs485
lots of stuff. Code, demo kits, ect.
rs 485 is similar to rs 232 but with differential drivers.
So, you may want to Google pic rs 232, or pic usart.
Also check Microchip App notes.

 
Hiya-

You are in luck. And I guess this is the right group to be talking with.

There are various free tools that you can get from Microchip to implement your task. The assembler and a simulator is free from them. Just wander over to the website.

Depending upon the complexity, there are even (I believe) free allbeit limited versions of the C complier available. I personally use the CC5X (search google) for a copy of their software. Their's is kind of strange. The *FIRST* commercial project you use it for is FREE, then you are supposed to buy a copy for any additional ones......

Since this seems to be a "commercial" project, I think that you will find that spending a little bit of money for development hardware might be a great tradeoff for your efforts.

I would suggest that you look at the microchip's "bottom end" hardware development stuff. Specifically the PICKIT II which can be had for very little money. Also, maybe buying a development board would prove cost effective. That way, you know you have some core hardware that works.

Instead of the 16F628 (which is a fine processor) you might consider the "newer" version of the chip the 16F648 which is only a couple of pennies more in cost, but allows one some additional features. Not the least, the doubling of the flash memory size. It is pin for pin compatible, and might prove to be cheaper over time as they tend to have the older processors become lower in quantity and hence higher (a little) in cost.

There are various "self help" guides on the web I liked the one from Nigel:


I didn't use the prototyping system he did. I got one of those "push in" breadboards and it worked just fine for me.
That and a 5V power supply and a logic probe is almost all that is/was needed to get the tutorial stuff done. A handful of LEDs and resistors, maybe a cap or two and you are ready to rock and roll.

For the rs485 portion of the code, well the rs485 is only the electrical interface connection, not a "protocol" for devices. For that, you can easily simulate the interface using rs232, then after it's working, convert to rs485 either with custom hardware or some commercially available converters. For the "other end" of the device, if one has an RS232 port on the PC, one can (with some "funnies" on the PC side) use Hyperterminal in a windoze system or minicom on a 'nix system. I prefer minicom as there are many less "gottchas". In fact it might be interesting to hear from the group as to their recommendations for the windoze application of choice in lieu of hyperterminal.

This little note should get you started. Oh, and there are many other fine microprocessors out there. Many folks like the AVR line of them. I got started with the PIC and since the majority of the investment is in the learning curve, I found no reason to change over. I have done some AVR programming, but the pic for me is the tool of choice for the class of applications that it covers.

One other thing, the PIC is a "Harvard" or non Von Neumann architecture. Many folks find the instruction set irritating. For me however, I found that the device lends itself well to basically I/O processing.

Hope this helps.

Cheers,

Rich S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top