Dear All:
I am working on a project in the university, one part of the project is to program the C167CR controller so that it can receive RS485 signals from other controller and based on the received data (which is Frequency & Duty cycle) the C167CR will generate PWM signal/s. Now, I have to build a prgram that enables the build in RS485 on the MiniModule-167, in order to be able to comunicate with the other controller. I have checked the manuals and the articles on the Keil website, but unfortunately there is nothing about RS485.
Please advise.
Your suggestions and help are highly appreciated
Thank you in advance
Best Regards,
Dear Ulf Sass:
Actually the development board which I have is MM-Basis-1117.4, and as mentioned in the manual, I just need to change the configurationof some jumpers in order to connect the Rs-485 driver to DB-9 socket at P2.
My problem is, how I can build the C code so that I can program the P2 as RS-485, also how I can program the C167 microcontroller in order to receive the data stream from other microcontroller (through RS-485).
As per your advise, I look for the CAN driver, and I found it.
Thank you for your support.
Then you just have to change these jumpers.
About software - there are no established standard for RS485 communication. You need similar ISR as for normal RS232.
The thing is that it is half-duplex, so the master must turn off the transmission to be able to hear the answer from the other side. That means that the RS485 transceiver on the board must have a transmit-enable signal connected to the processor. It may also have a receive-enable signal but normally not.
Your job it to turn on transmission, send a packet, and as soon as the last byte has been sent out, turn data direction and wait for an answer. So, no real need for any RS485 source code. Just an understanding of when en how to enable/disable the output from the RS485 transceiver.