3.0 Interfaces



IRCF360TM Interfaces, Power connection and PIC programming

The IRCF360TM has been designed so it can be easily connected directly on top of a robot controller’s. The connection should take place from underneath the PCB to avoid disturbing the proximity sensing areas.

Serial Interface to a robot controller

IRCF360 can be interfaced to almost any  micro-controller or robot controller– Examples are:

With Integrated Motor Controllers

....or many other robot micro-controllers. 

The robot controller needs to be able to handle asynchronous serial communications on a spare I/O pin or UART port. 

Power Supply

The IRCF360TM requires a 5v regulated power supply,  which normally can be provided directly from the robot controller.  The IRCF360TM has no reversed connection protection,  so it is important to pay attention to the polarity of the power supply; otherwise the IRCF360TM microcontroller may be destroyed!  

To prevent connecting the connector the wrong way, you could place a peg in one of the unused pins or perhaps use the 4 fixing holes to orientate and anchor the IRCF360TM the correct way around. 

Ensure to check that the power supply on the robot controller is the correct voltage and can supply the necessary current. It is particularly important that you measure the voltages and currents from the robot controller so connection will not destroy your robot controller or the IRCF360TM Connect at your own risk!

Disclaimer: It's important you first check that all the cables are connected the correct way around BEFORE connecting the 5v power supply or connecting to the IRCF360TM.


USART / RS232 / Serial Specifications

The IRCF360TM delivers asynchronous serial data with a 'RS-232' format. Although the voltage is outside the RS-232 standard, it is suitable for interfacing to most robot controllers. The main benefits with this design is that it can be connected directly to most micro-controller's UART port or software configured port without any external RS232 levelling translator. 

Connection methods

A 3-pin header connector is required to connect the IR Control Freak module to the  micro-controller. The connection should take place from underneath the PCB to avoid disturbing the proximity sensing areas. 

The connection could either be via a ribbon cable:


or via a female pin header connect on the robot PCB: 



Ribbon Cable Connection

When making your own cables it is good practice putting a short piece of heat-shrink sleeving around each cable end and connector, or using a glue gun to stick the cables together. This will help prevent the cables breaking at the solder joint.


Pin Header Connections

The following dimensions are provided for the connector alignement:  


Dimensions of Pin Header connector (click to enlarge)

Pin Header on Solder-side of PCB (click to enlarge)


 Pin1          Pin2  Pin3  Pin4  Pin5  Pin6  Pin7  Pin8
MCLR  VDD (5v)  VSS (GND)   PGD    PGC VSS
(GND)
   
TX    

    RX             
No used for normal operation 5v Supply from the robot controller Ground power supply from the robot controller No used for normal operation  No used for normal operation   Ground
 Needs to be connected to the ground of the robot controller.
  Serial port Transmit -> connected to RX on Robot Controller  Serial port Receive -> connected to TX on Robot Controller 


Pins 1, 4 & 5 are provided for in-circuit programming and are only required to if you intend to write and load your own firmware program (see PICkit2 below). It can also be used for loading new firmware versions. If you don't have or intend to purchase a PIC programmer the ROBOTmaker offer an upgrade service. Just remove the chip from the socket (take care not to bend any pins when taking this out of the socket) and return it to ROBOTmaker. We will re-load it with the latest software version for free (only postage is charged). If you have a PIC programmer and are a registered customer we will give you access to download the latest firmware versions. More details, on how to download the latest Firmware and references to ‘in-circuit programming’ are covered on the ROBOTmaker website.


Interface to a PC

If direct connection to the PC is required and you don't own a PICKIT2 (see section below)  then it is recommended to purchase an external MAX232 RS232 levelling translator such as the Acroname BrainStem  which is also available from ROBOTmaker store

These are also available as USB versions and can be used for programming certain micro-controllers such as Arduino and Megabitty that have a boot loader pre-installed or available to be programmed into them via the PICKIT2TM Microchip (See below)

A RS232 levelling translator will normally take care that the voltages will not distroy the IRC360, but it is customer's responsibility to check and that the voltages and currents from the PC will not destroy your robot controller, IRCF360 or your PC! Connect at your own risk!

NOTE: The PICkit2 has it's own terminal program built in, so you can read and write to the serial port of the IRCF360. So if you have one of these then the MAX232 is not required (see section on PICkit2 below for more details).


Serial RS232 Levelling translator with 9 pin D-connector. 
USB versions are also available


Programming and Connection to a PICkit2 (TM Microchip)

If you are not interested in PIC programming, then skip this section.

For the more advanced PIC programmers,  who would like an even bigger challenge of writing their own sensor programs,  then IRCF360 is pin-for-pin compatible with the PICkit2TM ( Microchip) programmer, which is available from many distributors such as Farnell - at very reasonable prices (note that there are many clones on the market which are often much more expensive than buying the original from Farnell or other reputable distributor). 

You can also buy one of these bundled with a 16F887 development board 'PICkit2TM  Debug Express' which is really good value if you want to start learning to programming. 

We mention the PICkit2TM  a lot,  rather than the PICkit3TM, as we have found this to be better designed and more robust in terms of reliability and functionality compared to the PICkit3  for the devices we used (the PICkit3 will program the new devices too though). One other cool features of the PICkit2TM is that it comes with it's own terminal program so you can display serial communication on the PC screen, without the need of a MAX232 interface and also has a logic analyser functionality. These features are unfortunately not yet available on the newer PICkit3TM (but check Microchip website for latest updates)

With a spare PIC16F88 chip (also available from our shop), why not try to roll-your-own sensor codes. For example, develop a 3D mouse or 3D dynamic midi music sensor that plays music or a drum machine based on the 360 degree IR sensor readings. See example midi code and videos to try -> here or perhaps your own infrared remote control routines?

 

It's easy to start programming your own PICTM (microchip) using one of the many compilers on the market these days. Here are some examples:

Visual Basic programming style

C programming style


Connection of PICkit2TM

The programming connector is a 6-pin header (0.1") spacing that connects to the IRCF360.

Serial connection Cable for programming and terminal program connection


IRCF360    PICkit 2
GND   Pin 3 VSS  
TX     Pin 4 SPDAT  
 RX   Pin 5 SPCLK 

 


Comments