IRPyro Micro controller template only
Routines to enable the MCU to use the USART and the I2C
Getting Started

This section describes how to use the IRPyro API. It part one describe the use "as is" and part two describe the customization process of the GPIO, I2C and User modules for use with other micro controllers.

For information on the sensor itself see: "IRPyro Sensor Reference Manual.pdf"

Part 1: To use the firmware "as is" in the current configuration


Attention
The current set of files included with this release are customized for the STM32F303 family of MCUs

Software

Hardware

Note for IRPyro demo board users (See "IRPyro Sensor Reference Manual.pdf":3 Ordering Information)

@verbatim

The PCB is connected to the MCU as follows:

For an IRPyro demo board the SDA and SCL pins are located on PORTB: 7,6

For an IRPyro demo board the CS pins are located on PORTB: 1,5,4,3

For an IRPyro demo board the INT pins are located on PORTA: 4,5,6,7

IRPyro demo boards PIN assignments

  • SDA PORTB GPIO_Pin_7
  • SCL PORTB GPIO_Pin_6
  • U1 CS: PORTB GPIO_Pin_1 INT: PORTA GPIO_Pin_4
  • U2 CS: PORTB GPIO_Pin_5 INT: PORTA GPIO_Pin_5
  • U3 CS: PORTB GPIO_Pin_4 INT: PORTA GPIO_Pin_6
  • U4 CS: PORTB GPIO_Pin_3 INT: PORTA GPIO_Pin_7

Part 2: To use with own MCU

Software

Hardware

GPIO configuration

See Micro_controller_template.c

The MCU to be used should be capable of providing:

  • Two dedicated pins for I2C bus communication.
  • UART capability to send collected data to a serial terminal.

Optionally

  • One pin configured as an OUTPUT pin, to control the CS line and turn ON/OFF the IRPyro.
  • One pin configured as an INPUT pin to read the state of the INT pin, which to indicates when data is ready.
        IRPyro break out board PIN assignments (IRPYxxxxx-B1)

         VDD  -   pin 1      pin 2   - NC   
         SCL  -   pin 3      pin 4   - SDA  
         CS   -   pin 5      pin 6   - INT  
         SYNC -   pin 7      pin 8   - CLK  
         NC   -   pin 9      pin 10  - GND  

I2C configuration

See Micro_controller_template.c

  • Modify i2c_Init() to allow the chosen MCU to function as I2C master
  • Modify i2c_Read() to be able to perform a READ operation on a slave device on the I2C bus
  • Modify i2c_Write() to be able to perform a WRITE operation on a slave device on the I2C bus

Modify provided micro controller specific functions

See Micro_controller_template.c


Part 3: Run the examples in main.c

The example configure the MCU. A serial terminal like RealTerm or similar is useful to see the messages generated.

USART configuration

A basic USART implementation allows the examples to send data to RealTerm using UART_stream_char_send() for plain text and UART_stream_binary_send()

The settings for serial communication are as follow:

            Baud Rate:           921600
            Parity:                None
            Data Bits:                8
            Stop Bits:                1
            Hardware Flow Control: None
            Software Flow Control: None

Examples

The following examples are included:


@page change Change Log

Release 1.0.0

Date
March 2018

Changes

Released as a stand alone project for the KEIL compiler.

New Features

Bug Fixes