I was looking for an answer to a question posted on the Hackster.io community site concerning support for Python on an Infineon PSoC board. My initial web search led me to Zerenth.com, where I found out that unfortunately Zerynth no longer supports PSoC. Later I discovered that there is an incomplete port of MicroPython on the web:
Anyone can give it a try if they have a CY8CPROTO-062-4343W around and 10 min -> https://ifx-micropython.readthedocs.io/en/latest/psoc6/intro.html
Well, if there is a Github repo and documentation I might as well give it a try and see what MicroPython can do.
My experience with Python is quite limited; I have made small changes to existing Python programs, but I have never developed a full system in Python. Moreover, my experience with MicroPython is even more limited, since I have never even tried it on any development board.
The obvious place to start with any new programming language is with the classics: Hello_World, and Blinky. Let’s see if I can create a MicroPython program that prints Hello World on the screen, and blinks the LED on the board.
Of course, it is normally considered ‘cheating’ to read the documentation before trying and failing, but since I have no idea what I am doing, I suspect that reading the provided documentation is the best place for me to start. Maybe the documentation will have a Hello_World or Blinky program.
Starting here: https://ifx-micropython.readthedocs.io/en/latest/psoc6/intro.html I checked the supported board list. The list is really short (one board, CY8CPROTO-062-4343W), but fortunately that is a board I happen to have on my desk. The getting started guide has Linux instructions so, since I normally do all of my development under Linux, I fired up a VM with Ubuntu 22.04. Here is what I did to get started:
𝚌𝚞𝚛𝚕 -𝚜 -𝙻 𝚑𝚝𝚝𝚙𝚜://𝚛𝚊𝚠.𝚐𝚒𝚝𝚑𝚞𝚋𝚞𝚜𝚎𝚛𝚌𝚘𝚗𝚝𝚎𝚗𝚝.𝚌𝚘𝚖/𝚓𝚊𝚎𝚗𝚛𝚒𝚐-𝚒𝚏𝚡/𝚖𝚒𝚌𝚛𝚘𝚙𝚢𝚝𝚑𝚘𝚗/𝚙𝚘𝚛𝚝𝚜/𝚙𝚜𝚘𝚌𝟼/𝚝𝚘𝚘𝚕𝚜/𝚙𝚜𝚘𝚌𝟼/𝚖𝚙𝚢-𝚙𝚜𝚘𝚌𝟼.𝚜𝚑 > 𝚖𝚙𝚢-𝚙𝚜𝚘𝚌𝟼.𝚜𝚑𝚌𝚑𝚖𝚘𝚍 +𝚡 𝚖𝚙𝚢-𝚙𝚜𝚘𝚌𝟼.𝚜𝚑
And as expected my VM told me that curl was not installed. After installing curl I tried again. Things happened, beautiful ASCII art appeared:
After connecting the board hitting the ANY KEY (apparently the spacebar is not an ANY KEY, I had to press the ENTER key) many more things happened, and code was installed onto my board:
I wasn’t fooled by the ‘any key’ this time, I pressed the enter key and many more things happened, then the Arduino Lab for MicroPython popped up on my screen, just like the instructions said would happen.
Pressing the connect button told me that /dev/ttyACM0 was available, clicking on the text opened the port and the console started up:
I won’t bore you with the rest of the details, but when I tried writing a Blinky program I discovered that the sleep function has not been implemented yet (just like the documentation says), the following program runs, but VERY quickly.
from time import sleep
from machine import Pin
p1 = Pin("P13_7") # LED pin for CY8CPROT-062-4343W
for i in range(0, 100):
I am looking forward to the next release. Hopefully the sleep function will work and the board will be able to do more useful things. 😉
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By technically required cookies we mean cookies without those the technical provision of the online service cannot be ensured. These include e.g. cookies supporting essential services like a smooth reproduction of video or audio footage. So called ‘functional cookies’ are also assigned belonging to this category. Functional cookies store information in order to provide you comfortable use of our online services (e.g. language selection). The legal basis for the processing of personal data by means of cookies of this category is Infineon’s legitimate interest. This includes, among other things, the interest in having a professional external presentation as well as an optimal balancing of the loads on the server due to technical reasons.
By performance and marketing cookies we mean cookies which are technically not required. We use performance and marketing cookies only if you have given us your prior consent. With such cookies, we collect information about how users interact with our website and which pages have been visited. This helps us to understand user activity on our website on an aggregated as well as on a personal level to provide you relevant content and services.