CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

MODBUS RTU RS-485 Master Slave

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
José Aparecido



Joined: 29 May 2019
Posts: 21

View user's profile Send private message

MODBUS RTU RS-485 Master Slave
PostPosted: Wed May 29, 2019 6:39 am     Reply with quote

Hi, I'm a student of the technical course in electronics of the SENAI school.
I need to develop a project for my TCC which is as follows: I've a PIC18F4550 microcontroller and a CFW500 frequency inverter; I need the microcontroller to request some data from the frequency inverter and display it on an LM044L LCD display.
I will use the MAX485 and RS-485 transceiver. I'll program in C and use the CCS C Compiler.
Anyone can send me some library or some code to help me do that?
Note: I'm a beginner in C language.
The project will not be for profit, it will be purely for learning.
Thanks any help
Confused
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed May 29, 2019 7:37 am     Reply with quote

Start by breaking down the project into small sections.
First, get the PIC to run a '1Hz LED' program.
Next, get the PIC to control the LCD module. Use the 'flex_lcd' driver in the code library here.
Next, get the PIC to communicate with a PC. I'm assuming you've chosen the 4550 for it's internal USB? If so, CCS has a driver for that as well. After dealing with the 4550 for about a year, I chose a $1 solution to buy a TTL<>USB module. It made projects a LOT easier and faster to get to market.
Now, cut code for the cfw500. You'll need to source out the command/control data format for that. While the hardware is RS-485, you'll have to code the software. It's unlikely anyone here has a driver, though you could use Google 'cfw500 PIC command' or similar keyword.

Jay
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Wed May 29, 2019 9:46 am     Reply with quote

There's an example RS485 code in the examples folder for the compiler, and also example code. I used the modbus library myself and it works well for me. Make sure you read your datasheet carefully.
José Aparecido



Joined: 29 May 2019
Posts: 21

View user's profile Send private message

Reply @dluu13
PostPosted: Thu May 30, 2019 4:44 am     Reply with quote

dluu13 wrote:
There's an example RS485 code in the examples folder for the compiler, and also example code. I used the modbus library myself and it works well for me. Make sure you read your datasheet carefully.


Thanks!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group