482 views|0 replies

141

Posts

4

Resources
The OP
 

【CY8CPROTO-063-BLE】4. Some GPIO operations [Copy link]

This post was last edited by Tristan_C on 2024-1-10 19:55
Some GPIO operations
Through the previous experiences, I have felt that the development environment of Infinenon is indeed powerful and easy to develop. This time, I will experience some GPIO development, starting with the simple ones.
First, open PSoC Creator, select Open a demo, search for PSoC 63 chip, and filter by GPIO. Click to open the second demo code, GPIO_Pins
After creation, the overall framework is as follows
The details of the schematic diagram are shown in the figure below, where the code is:
  1. A button is created and connected to P0_4. From the figure, there are no external pull-up and pull-down resistors. It should be necessary to pull it down internally. The high level indicates the pressed state.
  2. Two LEDs were created and connected to P0_3 and P11_1 respectively. A 10K resistor was connected to each LED and the LEDs light up when the voltage is high.
  3. A global signal is created for the interrupt of Port0, which seems to be used for the button IO, that is, the button uses the interrupt mode.
Here we also reselect the chip model used for the project, that is, the BLE module selected as follows
Let’s go back and look at the project and code
First, look at the code of the M0 and M4 cores respectively.
It can be seen from the code of M0 that it does not contain any content related to executing the application.
The application code is executed on the M4 core.
Looking at the code in detail, the button pin is mainly designed using interrupt mode.
And in the main function, according to the interrupt status, the IO port status of the LED is inverted to control the on and off of the blue LED.
The red LED will remain on or off according to the button status during power-on initialization.
When you try to compile, you will see a lot of error messages. These are all IO port problems. At this time, you need to go back to the hardware correspondence.
According to the actual hardware schematic diagram of the following development board, the design of two LEDs and buttons
Reassign GPIO
Change to
The actual drawing of the button layout changes the rising edge to the falling edge, removes the internal pull-up and pull-down resistors, and uses external pull-up.
Compile and download to the chip.
Then use the button to control the LED to light up.
In fact, it can be seen from here that this chip platform is still very flexible and open. The two cores are basically completely open to users, including the BLE protocol stack. It is also up to the user to choose which core to run on. The degree of openness is still quite sincere.
CE220263_GPIO_Pins01.rar (5.57 MB, downloads: 2)
This post is from RF/Wirelessly
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
Happy Knowledge: How is the CPU made?

If calculated by price/weight, CPU is much more expensive than gold. Almost everyone knows that CPU is mainly made of si ...

[Ateli Development Board AT32F421 Review] +LED Run

Because of some family matters, I went back to my hometown and haven't updated for a while. In fact, the LED program h ...

[Flower carving DIY] Interesting and fun music visualization series of small projects (04) --- WS2812 strip light

This post was last edited by eagler8 on 2021-10-8 19:08 I suddenly had the urge to do a series of topics on sound visua ...

After the microcontroller is powered on, it runs a display program and encounters a very strange problem.

The code is as follows: while(1) { ee=1; xsint(ee); delay_ms (3000); WDTRST =0x1E; WDTRST = 0xE1; ee ...

[Hua Diao Experience] 05 Building a development environment for Xingkong board: SSH connection and Jupyter programming

This post was last edited by eagler8 on 2022-6-17 04:50 Xingkong Board supports a variety of programming software. In a ...

OTL circuit analysis problems

As shown in the figure, the OTL circuit Why can resistors R5, R6 and diode D1 ensure that transistors V2 and V3 are in ...

[HPM-DIY] HPM6750 MicroPython transplantation is successful

It took two nights to successfully port the minimally configured MicroPython. Next, we connected it to the hardware to ...

[Xingkong board Python programming learning main control board] Portable juice spectrometer based on Xingkong board

This post was last edited by HonestQiao on 2022-11-21 10:53 Table of contents: 1. Origin of the idea 2. Hardware Mater ...

[Evaluation of STM32L452Nucleo-64] Module testing by lighting up LEDs and OLEDs

1. Light up an LED lamp Software programming often starts with outputting "Hello World". In embedded development, we o ...

Which Linux development board should I choose to get started?

Hello everyone, which model of Linux development board should I choose? Are there any recommended models for entry-level ...

快速回复 返回顶部 Return list