MCUXpresso SDK Tutorial – using I2C Driver on OKdo E1 board

In an earlier tutorial I introduced using I2C with the NXP LPC55S69 on OKdo E1 board to read a Bosch BME280 environmental sensor on a Mikroe Weather Click board. The MCUXpresso Clocks, Pins and Peripheral Config tools were used to get it running. It’s all for my Weather Station project that I’ve been working on during these months of lockdown. It is starting to take shape – as you can see from the photograph:

From the left: Mikroe Weather Click, OKdo E1, Mikroe eInk Click.

Now I really need to start reading and writing to the BME280 sensor, and that means using the I2C driver in the lpcxpresso55s69 SDK. And so this week I’ll provide a forensic examination of the most commonly-used I2C function call.

Continue reading

MCUXpresso tutorial: I2C using the Pins/Clocks/Peripherals Config tools and lpcxpresso55s69 SDK

I selected the Bosch BME280 environmental sensor as the heart of my OKdo E1-based weather station. It is convenient to use, and I can prototype with the Mikroe Weather Click board MIKROE-1978. But the sensor is accessed over I2C, and that is my least favourite of the communication interfaces. In this short tutorial, I show you how the MCUXpresso Config tools (Pins, Clocks, Peripherals) are used to set up the I2C driver from the MCUXpresso lpcxpresso55S69 SDK. And very quickly, I am able to communicate with the BME280 sensor.

Reading BME280 “ID” register via I2C
Continue reading

Getting Started: ROM Bootloader on the NXP FRDM-KL03Z Board

A bootloader on a microcontroller is a very useful thing. It allows me to update the firmware in the field if necessary. There are many ways to use and make a bootloader (see “Serial Bootloader for the Freedom Board with Processor Expert“). But such a bootloader needs some space in FLASH, plus it needs to be programmed first on a blank device, so a JTAG programmer is needed. That’s why vendors have started including a ROM bootloader into their devices: the microcontroller comes out of the factory with a bootloader in FLASH. So instead writing my bootloader, I can use the one in the ROM.

FRDM-KL03Z with ROM Bootloader

FRDM-KL03Z with ROM Bootloader

And as with everything, there are pros and cons of that approach.

Continue reading

Enabling/Disabling FXOS8700CQ Device Needs a Delay

Found an interesting behaviour with the Freescale FXOS8700CQ on the new Sumo Robots (see “Sensor and Communication Shield for Sumo Robot“): when enabling the accelerometer/magnetometer, it actually did not work:

Failed to Enable FXOS8700 Accelerometer

Failed to Enable FXOS8700 Accelerometer

Continue reading

IoT: FreeRTOS Down to the Micro Amps

University research projects can be a lot fun, and are very challenging the same time. The good thing is that there is always someting new to learn :-).

This week-end I was working on my Internet of Things (IoT) project, based on a Freescale KL15Z and a nRF24L01+ transceiver. In essence it is a wireless data logger. For this, I only can afford a few micro amps consumed by the whole board over an extended period of time. I mean 21 micro amps for running a whole board with sensor, EEPROM, wireless transceiver, operating system and an ARM Cortex-M0+ ready to crunch numbers at 20 MHz 🙂

21 micro amps for wireless sensor node

21 micro amps for wireless sensor node (when not sending)

Continue reading

Review: New FRDM-KL26Z Board

I probably would have missed the fact that Freescale has released a new Freedom board, if I would not have visited my local distributor site to order a replacement for one of my first FRDM-KL25Z boards. So surprise, surprise: there is a new Freedom board: the FRDM-KL26Z!

FRDM-KL26Z Board

FRDM-KL26Z Board

So instead ordering again a FRDM-KL25Z, I decided to order that new FRDM-KL26Z instead. And it arrived right before Christmas, and now I had time to check it out. Nope, I did *not* use it as a blinking gadget on a Christmas tree, even if that would have been a nice idea ;-).

Continue reading

Bit-Banging I2C with ResetBus() Functionality

The good thing with the internet is: it allows engineers to collaborate. And here is an example: Marc is a reader of this blog had a problem with the I2C hardware of a Freescale Kinetis ARM microcontroller. In his case, the I2C bus could be stuck, and there seems no way to reset it with the I2C hardware on the microcontroller. So a solution would be to reset it with software instead.

Bit Banging Software I2C Driver

Bit Banging Software I2C Driver

Continue reading

Zumo Robot assembled

This week we were busy with building and documenting the first robots based on the Zumo Robot Chassis PCB.

Chassis Base PCB

The chassis is designed to hook up the FRDM-KL25Z board from Freescale. It is using parts from Pololu (chassis, motors, DC-DC converter, line sensor, H-Bridge, encoders):

ZumoBaseBoardOverview

Zumo Base Board Overview

Continue reading

Extended Driver for the MMA8451Q Accelerometer

In “Tutorial: Accelerating the KL25Z Freedom Board” I used the MMA8451Q accelerometer on the FRDM-KL25Z board in a very primitive way: I’m reading directly some low-level registers from the device through an I2C low-level component. No calibrating, no special device feature setting, only raw values. Since then, things have been evolved: In “Tutorial: Creating a Processor Expert Component for an Accelerometer” I started to create a driver for this accelerometer, and since then a lot more functionality has been added.

Tracing Accelerometer Values to the Shell

Traced Accelerometer Values to the Shell

Continue reading

Tutorial: Creating a Processor Expert Component for an Accelerometer

If you are a frequent reader of this blog, then you know: I’m a big fan of Processor Expert components. While there are many Processor Expert components delivered with CodeWarrior, it lacks many components and device drivers beside of the normal on-chip peripherals. But value gets added to an embedded project with all the external devices, sensors and actuators. That’s why I have created many more components which are available on my GitHub site. Readers of this blog have asked several times to create a tutorial on how to create a Processor Expert component. So why not working on that on a long Easter weekend full of cold rain and snow?

So here we go: a tutorial how to create a Processor Expert component for the MMA8451Q accelerometer found on the FRDM-KL25Z board:

MMA8451Q Accelerometer on the FRDM-KL25Z Board

MMA8451Q Accelerometer on the FRDM-KL25Z Board

Continue reading