View previous topic :: View next topic |
Author |
Message |
José Aparecido
Joined: 29 May 2019 Posts: 21
|
MODBUS RTU RS-485 Master Slave |
Posted: Wed May 29, 2019 6:39 am |
|
|
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
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Wed May 29, 2019 7:37 am |
|
|
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
|
|
Posted: Wed May 29, 2019 9:46 am |
|
|
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
|
Reply @dluu13 |
Posted: Thu May 30, 2019 4:44 am |
|
|
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! |
|
|
|