Communication of 2 different microcontroller(Rs485)

Thread Starter

Burak Doğançay

Joined Jul 20, 2016
5
Hello everyone,

First of all, I would like to inform you that I really apreciate your consideration of response for embedded projects.

Recently I decided to study on microcontrollers and communication procedures of them.(includes UART,I2C,SPI Serial communication protocols)

In this case, I started to learn rs485 serial communication for embedded projects.Therefore I will improve my skills for both side(embedded programming and electronics)

So,I am trying to learn serial communication and configurations of microcontrollers.I started to one project which includes rs485 communication of two microprocontrollers.

In this project, I would like to send a string value from one microcontroller to another. I have made a project based on gps,gsm and arm microcontroller communication via USART 2 months ago.
So, I improved myself for arm microcontroller programming and the project works perfectly.

Bu this time, I would like add something new to this project and that will be consist of rs485 serial communication.In this situation I would like to create a basic microcontroller circuit that will send a data(string value) over rs485 serial communication.

The project implementation and duty is;

This new microcontroller circuit will send integer value to my gps,arm microcontroller based project for authentication.
So, It means that; If we make a communication between these microcontrollers, my new microcontroller based circuit will send a data to old arm microcontroller and then arm microcontroller will get this data from new microcontroller and process related data inside.

Thus,I should choose a microcontroller which is capable to send single data via rs485 transciever to arm.So, This microcontroller should include Uart pin configuration and it should be available on the pins.The controller should be cheaper and easy to manage and integrate registers,timers,interrupts ..etc.

Could you please suggest me, what type of controller may i use to send single data via rs485 transciever?

What should I consider to choose this microcontroller?

Which model is apropriate (Coul you please inform exact model and it should be cheaper).

Also configuration of this microcontroller should be easy in the case of rs485 communications(registers,interrupts for rx,tx, sleep mode configuration ...etc)

Will it be appropriate sample codes on the internet for a given model?

Thank you in advance.
 

Sensacell

Joined Jun 19, 2012
3,453
Your specific question is not really answerable.

RS-485 requires a micro with a UART at the bare minimum.
Since you have provided scarce detail about what your system needs to do, just about any micro-controller with a UART will do.
You just need to add an RS-485 transceiver chip.

You will find that controlling the TX enable pin is the most critical aspect of the task.
Do you intend to create a multi-drop network? or only point to point?

Texas Instruments makes a few good RS-485 chips, read the application notes for these parts to learn more.
 

Papabravo

Joined Feb 24, 2006
21,228
With RS-485 it matters a great deal how many nodes you plan to have in the network and how you plan to control the transmitters. Unlike RS-232 which is point to point and full duplex, RS-485 is multi-drop and half duplex. Understanding the distinction will be critical to design success.
 

Thread Starter

Burak Doğançay

Joined Jul 20, 2016
5
Yeah, this microcontroller is going to handle simple thing.It will just send a data via rs485 data line with transciever.

And yes it is going to include multidrop networt, because There will be another devices to communicate via this rs485 data line.In this case my old 32-bit arm microcontroller will manage all these devices + this simple microcontroller will send a data for just authentication to arm.But this operation will not be related to other process of devices.

I just would like to learn, which type of simple microcontroller should ı use.Pic? , atmel atmega 8-bit microcontroller ? or even arm.

It should be really cheap and configurations(Interrupts, registers...etc) should be understandable with examples
 

Papabravo

Joined Feb 24, 2006
21,228
Yeah, this microcontroller is going to handle simple thing.It will just send a data via rs485 data line with transciever.

And yes it is going to include multidrop networt, because There will be another devices to communicate via this rs485 data line.In this case my old 32-bit arm microcontroller will manage all these devices + this simple microcontroller will send a data for just authentication to arm.But this operation will not be related to other process of devices.

I just would like to learn, which type of simple microcontroller should ı use.Pic? , atmel atmega 8-bit microcontroller ? or even arm.

It should be really cheap and configurations(Interrupts, registers...etc) should be understandable with examples
It just doesn't matter which one you use. they will all work just fine.
You are still ignoring the problem of how you will manage the transmitter enables for all of these nodes. I'll give you a hint, please pay attention. All of the little micros with transmitters will need to be receivers so they can know when it is appropriate to transmit. If you ignore this problem you will have devices stepping on each other and as a result no meaningful communication will take place. Tell me you understand the problem.
 

Thread Starter

Burak Doğançay

Joined Jul 20, 2016
5
I didn't make any project for rs485 communication.Thus, I would like to learn how to manage interrupt and adjustment for data communication of each devices.

So, I am going to investigate how to program it and how to apply interrupts for rs485 communication.I am planning to use this simple microcontroller as Reciever and transmitter for feedback and different type of operation.(Sending data and get response from main arm microcontroller).But Other devices will be in slave mode.

For now, I have no idea what type of problems are faced.It should meet the required specifications (temperature considerations, easy to program, Uart communication ).I already specified transciever ıntegrated circuit for communication.
 

Thread Starter

Burak Doğançay

Joined Jul 20, 2016
5
I understood your question.It means if I use this second microcontroller there will be some problems for data transmitting between devices and these microcontrollers.But ı will think about it after ı choosed a microcontroller.
 

Papabravo

Joined Feb 24, 2006
21,228
I understood your question.It means if I use this second microcontroller there will be some problems for data transmitting between devices and these microcontrollers.But ı will think about it after ı choosed a microcontroller.
That is all fine, but don't waste too much time on the choice.
 
Top