Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Eng-Tips
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

djroseman (Electrical) (OP)
26 Mar 08 6:26
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
Madcow (Electrical)
26 Mar 08 11:24
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.

richs (Computer)
26 Mar 08 11:31
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:

http://www.winpicprog.co.uk/pic_tutorial.htm

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.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close