Jump to content
Sign in to follow this  
marcob

Rs232 Pic16f84

Recommended Posts

I would want to know if you have a simple ruotine in order to make one seriale that it receives and it transmits with the pic 16f84.(uso boostc).

 

If I take a ruotine made for the c2c I can use it, what is the difference :(;):o between boostc and the c2c? Thanks

Share this post


Link to post
Share on other sites

I had the same problem a few months back, and never found a solution. C2C was a great compiler, and even a dummy like I could output to the Scott Edwards Electronics serial LCDs. I must admit I'm ambivalent over BoostC.

 

I've read through the PIC18F2431 datasheet half a dozen times, and puzzled over the rs232 include file that ships with BoostC, but to no avail. If you have any luck with this, please post.

 

It was so easy with C2C!

Share this post


Link to post
Share on other sites

C2C rs232 code can not be posted because it doesn't exist in C form. It is generated at compile time by compiler and generated code depends on the clock frequency. The reasons we decided to do differently in BoostC are 1) we want to make rs232 code more flexible 2) let users see what's going on in the code 3) make generated assembly shorter and faster 4) don't mess with libraries. As result the rs232 functionality is implemented as a set of function templates that reside in a header file. To use rs232 functionality in BoostC it's enough to include the rs232 header into your code and setup ports/pins used in rs232 communication.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
I've read through the PIC18F2431 datasheet half a dozen times, and puzzled over the rs232 include file that ships with BoostC, but to no avail.  If you have any luck with this, please post.

 

The PIC18F2431 and derivatives use an enhanced (read different enough to cause problems) serial interface peripheral, the EUSART. For the most part it is backward compatible with the USART implemented in the 18F252/452 and variants. You can use the EUSART in compatibilty mode with the existing RS232 driver by changing slightly the initialization sequence and by not using any of the "Enhanced features" added with this device. The RS232 include file was initially developed for the PIC18F252/452 USART.

 

You have four options:

1. use a software serial port (emulated serial port) using the existing RS232 driver (quickest approach)

 

2. use the existing serial driver modifying the initialization code to set RCSTA.7 TRISC.1 and TRISC.6 (next quickest with higher performance than point 1)

 

3. implement a EUSART compatible interface in the existing driver (more development work and compatibility testing required than point 2 but giving more flexibility)

 

4. Write a EUSART specific driver (much more work but results in a more efficient driver and better code readability)

 

If developing your own driver for a specific project then the quickest way to do this is to forget about using templates. If however you would like to use the driver on various hardware platforms and to share with others then you should consider developing a templated driver version. The first couple of drivers are challenging but at least there are now a few examples you can examine and / or build on.

 

Rgds, Andrew

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...