There was once a time when I was so obsessed with creating a quadcopter on my own after I have watched the video series by Joop Brokking. I open the Mouser website as normal to search for the fitted microcontroller for the quadcopter, LPC55S6X series MCUs seem to have a good performance and rich connectivities with a low price. As I had a look at the datasheet of the chip, I was impressed. So I ordered the evaluation board immediately and waited for the delivery.
During the waiting time, I was eager to develop with the board so I followed the instructions said on the NXP website and set up the IDE environment before the delivery arrived. After the environment was set up, I took deep research into the User Manual of the chip. Instead of coding with API given directly, I prefer to play with the registers so that I can have a good understanding and better control of the chip. After days of researching the user guide, API codes and code examples, the development board finally arrived.
As a start, I powered the board up to play with the LED and buttons. It seemed that the LED still blinked when I pressed the button to make it hold at a colour. That's a bit alarming about the program logic. It is evident that the blink is controlled by a standard timer interrupt, which makes the blinking happen all the time.
I connected the board to my laptop and flashed a "Hello_World" demo program into it. It came up with errors with RedlinkServerException that indicates that the redlink server was not open. That's weird. I checked my firewall to enable the server to pass through both private and public network and even added the executed file manually, but those did nothing. After searching on the Internet, from two posts on the NXP forum: 1 and 2, I reinstalled the IDE and make the working directory of the IDE to a completely different folder. Finally, it works like charm.
Firstly, this is my first time to develop a dual-core Cortex-M33 microcontroller. Additionally, its high-end structure is a great upgrade for me from ATMega, MSP430 and ATSAMD21 (Cortex-M0+).
Secondly, it contains many features with high performance while the power consumption is low. As shown in the block diagram given in the datasheet,
There are two Cortex-M33 cores. One is a mainstream core with Floating Point Unit (FPU), Memory Protection Unit (MPU) and a math processing interface. The other one is just a core. A mailbox is used to communicate between two cores. There are independent Nested Vector Interrupt Controllers (NVIC) on both cores. They make the developer distribute the work to different cores according to the workload and types of jobs that the core is capable of. Direct Memory Access (DMA) can make the readings from communication interfaces like I2C, SPI and UART quicker to be accessed by the program. There are 5 standard timers with other types of timers, which makes the chip able to process with PWM or PPM signals. The communication interfaces are flexible so the user does not have to limit their routings and programming for series connections. SDIO interface makes it able to process files with an SD card.
If we look at the block diagram of Cortex-M33 core,
TrustZone is included to have wide access control. The use of the TrustZone will be talked about later in my blog.
Now, I have got a development board. How do I start to develop a quadcopter flight controller?
I draw a diagram for a quadcopter flight controller.
From the block diagram and my research in the sensors, there is a list of features that need to be learnt and implemented:
I will learn, understand examples, test with my own examples and build the functionality for each of the features listed above in the following blog posts.
There are not many videos and tutorials to work with LPC55S6x MCUs as it is a relatively new product released by NXP. Most of the developers develop cores from Cortex-M0 to Cortex-M7. So I have to learn it nearly by myself. Luckily, there is a Youtuber called embeddedpro who seems to develop NXP products publishing a list of videos about basic walkthrough and explanation of LPC55S69-EVK board.