RS485 Terminal Console Demo Quickstart Guide

Click the version drop-down list below to show all available versions

Version: 2.3.0rc0.b       Date: March 25, 2013
VersionReleasedComment
2.3.0rc0.bMarch 25, 2013 download view

This simple demonstration of the RS485 transceiver component uses the XA-SK-ISBUS Slice Card to:

  • Receive RS485 data packets sent from a terminal console via a USB-to-RS485 converter
  • Add +1 to the received characters and transmit the received packet back to the RS485 bus and thus back to the terminal console

Hardware Setup

The XP-SKC-L2 Slicekit Core board has four slots with edge conectors: SQUARE, CIRCLE, TRIANGLE and STAR.

To setup up the system:

  1. Connect XA-SK-ISBUS Slice Card to the XP-SKC-L2 Slicekit Core board using the connector marked with the TRIANGLE.
  2. Connect a USB to RS485/USB converter pins to header P1 on the ISBUS slice as follows: A (pin 1), B (pin 2) and GND (pin 3).
  3. Connect the XTAG Adapter to Slicekit Core board, and connect XTAG-2 to the adapter.
  4. Connect the XTAG-2 to host PC. Note that a USB cable is not provided with the Slicekit starter kit.
  5. Switch on the power supply to the Slicekit Core board.
Hardware Setup for RS485 Demo
/sites/default/files/images/16615/7/hardware_setup.JPG

Import and Build the Application

  1. Open xTimeComposer and open the edit perspective (Window->Open Perspective->XMOS Edit).
  2. Locate the RS485 Terminal Console Demo item in the xSOFTip pane on the bottom left of the window and drag it into the Project Explorer window in the xTimeComposer. This will also cause the modules on which this application depends (in this case, module_rs485) to be imported as well.
  3. Click on the app_rs485 item in the Explorer pane then click on the build icon (hammer) in xTimeComposer. Check the console window to verify that the application has built successfully.

For help in using xTimeComposer, try the xTimeComposer tutorials, which you can find by selecting Help->Tutorials from the xTimeComposer menu.

Note that the Developer Column in the xTimeComposer on the right hand side of your screen provides information on the xSOFTip components you are using. Selecting either the RS485 transceiver component or RS485 Terminal Console Demo component in the xSOFTip Browser will cause a page with links to both the component and application quickstart documentation to be displayed in the Developer Column Window. Once you have briefly explored the component documentaion, you can return to this quickstart guide by re-selecting the RS485 Terminal Console Demo Quickstart Guide link.

Serial Terminal Setup Examples

You will need to use a Serial Terminal on the PC to send and receive the data. Below are examples of two clients showing how they should be configured: PuTTY and RealTerm.

PuTTY

  1. Open the PuTTY program, the PuTTY Configuration Dialog should be showing
  2. Select the ‘Serial’ category, under ‘Connection’
  3. Set the ‘Serial line to connect to’ to match the COM port associated with the USB to RS485 device (this can be found in the device manager if not known)
  4. Set the ‘Speed (baud)’ option to 9600.
  5. Set the ‘Data bits’ option to 8
  6. Set the ‘Stop bits’ option to 2
  7. Select ‘None’ from the ‘Parity’ drop-down
  8. Select ‘None’ from the ‘Flow control’ drop-down
  9. Select the ‘Session’ Category
  10. Select the ‘Serial’ radio button
  11. Click ‘Open’
  12. Type 012345678 in to the terminal window, you should see the output as below
PuTTY Configuration Dialog
/sites/default/files/images/16615/7/PuTTY_Config.PNG
PuTTY Terminal Output
/sites/default/files/images/16615/7/PuTTY_Result.PNG

RealTerm

  1. Open the RealTerm program
  2. Select the ‘Port’ tab
  3. Select ‘9600’ (or whatever baud has been selected in the software)from the ‘Baud’ drop-down
  4. Select the COM port allocated to the USB to RS485 device from the ‘Port’ drop-down
  5. Select the ‘None’ radio button in the ‘Parity’ group
  6. Select the ‘8 bits’ radio button in the ‘Data Bits’ group
  7. Select the ‘2 bits’ radio button in the ‘Stop Bits’ group
  8. Select the ‘None’ radio button in the ‘Hardware Flow Control’ group
  9. Click the ‘Change’ button
  10. Select the ‘Display’ tab
  11. Click in the terminal window and type 012345678, you should see the output as below
RealTerm Configuration Dialog
/sites/default/files/images/16615/7/RealTerm_Config.PNG
RealTerm Terminal Output
/sites/default/files/images/16615/7/RealTerm_Result.PNG

Run the Application

Now that the application has been compiled, the next step is to run it on the Slicekit Core Board using the tools to load the application over JTAG (via the XTAG2 and Xtag Adaptor card) into the xCORE multicore microcontroller.

  1. Click on the Run icon (the white arrow in the green circle). A dialog will appear asking which device to cvonnect to. Select XMOS XTAG2.
  2. Using a serial terminal application, connect to the RS485 to USB converter, set to 9600 baud, 8 data bits, 2 stop bits, no parity.
  3. Once you are ready to run the demo click in the terminal window and type 012345678. The XMOS application receives each byte and increments it by one, so you will see 123456789 echoed back on the terminal window.

Next Steps

Look at the Code

  1. Examine the application code. In xTIMEcomposer navigate to the src directory under app_rs485 and double click on the app_rs485.xc file within it. The file will open in the central editor window.
  2. Find the main function and note that it runs the run_rs485() function on a single logical core, and a second application function on a second logical core.
  3. At the top of the application code file try changing the baud rate definition to a different value, change the baud rate in your chosen terminal application and reconnect.
  4. Find the application function. Note that the function waits for the rs485_run function to send it some data, buffer that data and then transmit the packet back. Try manipulating the data before returning it, eg. repeat it.

RS485 app : Quick Start Guide