Need support: Connect Pic32 MZ with Harmony I²C/I2C (Mikrobu

Need support: Connect Pic32 MZ with Harmony I²C/I2C (Mikrobu

Postby Jonas123 » Fri Jun 08, 2018 1:18 pm

Hi Guys,

newbie here.

I bought the DM990004 (http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=DM990004) IoT Kit for AWS (Amazon Web Services) and want to connect the air quality 3 click board (https://www.mikroe.com/air-quality-3-click) from MikroElektronika on the mikroBus with I²C (I2C).

I'm using MPLAB X iDE v4.15, Harmony v1.09, XC 32 Compiler v1.42 as recommended (and necessary) in the example Project for the IoT Kit on https://github.com/MicrochipTech/aws-iot-firmware-pic32mz/blob/master/documents/iot-ethernet-firmware-compile-and-program.md

Here is the whole example project
https://github.com/MicrochipTech/aws-iot-firmware-pic32mz

Debugger is a Pickit 3.

I just want to read the sensor data of the air quality 3 sensor and don't know exactly how to do it. The sensor has sda and scl pins, so it communicates with I2C.
There is a I2C library from MPLab Harmony which i try to use. I read the documents but I don't know how to use it and I wonder why there are no libraries for the mikrobus/click boards. Why can't I use the MPLab Code Configurator which has the option to include click board libraries for the PIC 32MZ EF?

Does the air quality 3 sensor works as a slave or master while transmitting its sensor data?

I'm short on experience programming hardware and I don't know where I have to start.
Many questions, the important one is how can i read the sensor data in my Project?

Thanks for your help!
Jonas123
 
Posts: 1
Joined: Fri Jun 08, 2018 1:11 pm
PIC experience: EE Student

Re: Need support: Connect Pic32 MZ with Harmony I²C/I2C (Mik

Postby Jorgef » Mon Jun 11, 2018 10:43 am

Hi

Besides my lack of specific experience with PIC32 devices, some things don't change.

1 - The sensor will be a slave in the I2C communication.
2 - To read the sensor and eventually control its operation you have to use the I2C chanel to implement, in your application code, the transactions defined in the sensor documentation.
3 - Harmony will provide the API to handle the I2C hardware of the PIC, but it shouldn't be expected to know the specifics of the multitude of I2C devices out there.

Bear in mind that I2C is just a communicatiin chanell, the specific commands/data protocol it carries varies from device to device. And beeing a multi-slave chanell the commands/data sets can be different for each slave on the same chanell.
Given that its obvious that the Harmony driver can't handle the slave specifics, it must be your application code to do it.
Best regards
Jorge
Jorgef
Verified identity
 
Posts: 14
Joined: Wed May 30, 2018 8:46 pm
PIC experience: Professional 5+ years with MCHP products


Return to PIC32 topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron