Recent

Author Topic: Cypress PSoC microcontrollers  (Read 501 times)

julkas

  • Sr. Member
  • ****
  • Posts: 383
  • KISS principle / Lazarus 2.0.0 / FPC 3.0.4
Cypress PSoC microcontrollers
« on: August 25, 2019, 02:27:55 pm »
Is there any Pascal IDE (Compilers) for Cypress PSoC microcontrollers?
procedure mulu64(a, b: QWORD; out clo, chi: QWORD); assembler;
asm
  mov rax, a
  mov rdx, b
  mul rdx
  mov [clo], rax
  mov [chi], rdx
end;

ccrause

  • Full Member
  • ***
  • Posts: 183
Re: Cypress PSoC microcontrollers
« Reply #1 on: August 25, 2019, 03:04:11 pm »
Is there any Pascal IDE (Compilers) for Cypress PSoC microcontrollers?

If they are Arm Cortex based then you should be able to use FPC/Lazarus. There are several users around who can give you much more specific advice.

MiR

  • Jr. Member
  • **
  • Posts: 67
Re: Cypress PSoC microcontrollers
« Reply #2 on: August 25, 2019, 04:37:36 pm »
Which Chip (or Chip Family) are you interested in?

When CMSIS Packs for that family are availableI can generate the Freepascal Units for you

Michael

julkas

  • Sr. Member
  • ****
  • Posts: 383
  • KISS principle / Lazarus 2.0.0 / FPC 3.0.4
Re: Cypress PSoC microcontrollers
« Reply #3 on: August 27, 2019, 01:24:40 pm »
Which Chip (or Chip Family) are you interested in?

When CMSIS Packs for that family are availableI can generate the Freepascal Units for you

Michael
Cypress PSoC 3,4,5.
procedure mulu64(a, b: QWORD; out clo, chi: QWORD); assembler;
asm
  mov rax, a
  mov rdx, b
  mul rdx
  mov [clo], rax
  mov [chi], rdx
end;

MiR

  • Jr. Member
  • **
  • Posts: 67
Re: Cypress PSoC microcontrollers
« Reply #4 on: August 28, 2019, 05:58:06 pm »
I downloaded psoc creator to try to find some decent header files but things do not look good.

I could not find any header files that look useable, there is a cydevice.h file that looks like a flat file representation of all registers but nothing that even closely resembles something I have ever seen and parsed before.

So I guess unless someone else already has a solution for you the chances to programm the cypress cpu's in FreePascal are slim to none.

If you have some real header files with register description then post a link here, I will have a look.

Michael



julkas

  • Sr. Member
  • ****
  • Posts: 383
  • KISS principle / Lazarus 2.0.0 / FPC 3.0.4
Re: Cypress PSoC microcontrollers
« Reply #5 on: August 28, 2019, 06:14:42 pm »
So I guess unless someone else already has a solution for you the chances to programm the cypress cpu's in FreePascal are slim to none.
Bad news.
procedure mulu64(a, b: QWORD; out clo, chi: QWORD); assembler;
asm
  mov rax, a
  mov rdx, b
  mul rdx
  mov [clo], rax
  mov [chi], rdx
end;

avra

  • Hero Member
  • *****
  • Posts: 1689
    • Additional info
Re: Cypress PSoC microcontrollers
« Reply #6 on: August 29, 2019, 09:10:45 am »
The only reason to justify (relative) higher price of PSoC is PSoC Creator IDE and it's visual programming GUI with built in and custom made peripheral components which can save some of the external hardware logic. If you cut that out then not much reasons are left for Pascal IDE which would not rely on PSoC Creator IDE (and such integration would be hard to achieve with such closed source IDE). And if you do not need peripheral components that badly, then something like STM32 has much better pricing and already has FreePascal support.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

MarkMLl

  • Full Member
  • ***
  • Posts: 142
Re: Cypress PSoC microcontrollers
« Reply #7 on: August 29, 2019, 12:21:43 pm »
The only reason to justify (relative) higher price of PSoC is PSoC Creator IDE and it's visual programming GUI with built in and custom made peripheral components which can save some of the external hardware logic. If you cut that out then not much reasons are left for Pascal IDE which would not rely on PSoC Creator IDE (and such integration would be hard to achieve with such closed source IDE). And if you do not need peripheral components that badly, then something like STM32 has much better pricing and already has FreePascal support.

What programmer does FPC support for that?

A minor caveat is that if you buy one of the cheap STM32 "Blue Pills" for experimentation using the Arduino IDE you also need an STLink programmer to get the boot loader on and need to solder a pullup resistor.
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

MiR

  • Jr. Member
  • **
  • Posts: 67
Re: Cypress PSoC microcontrollers
« Reply #8 on: August 29, 2019, 01:24:18 pm »
fpc supports debugging and programming with various probes, the major requirement is that a gdbserver for your debug probe is available.

Segger JLink is the best solution overall because it works flawlessly on Mac, Windows and Linux. Costs are $20-$50 for Edu.

Those cheap Aliexpress STLink Clones also work for them I'd highly recommend to flash them with Blackmagic:

https://github.com/blacksphere/blackmagic/wiki/Debugger-Hardware





 

avra

  • Hero Member
  • *****
  • Posts: 1689
    • Additional info
Re: Cypress PSoC microcontrollers
« Reply #9 on: August 29, 2019, 04:21:17 pm »
What programmer does FPC support for that?
Well I received my Blue Pill just few days ago and played with STM32 IDE, Mikroelektronika Pascal, Platformio and Arduino. With ST-Link v2 and first 3 you can debug from IDE. With 4th you can only program. I plan to play with FPC but had no time to do that yet. For FPC support you can find more info in the forum:
https://forum.lazarus.freepascal.org/index.php/topic,45966.0.html
https://forum.lazarus.freepascal.org/index.php/topic,45849.msg328333.html#msg328333

A minor caveat is that if you buy one of the cheap STM32 "Blue Pills" for experimentation using the Arduino IDE you also need an STLink programmer to get the boot loader on and need to solder a pullup resistor.
I bought both STM32 Blue Pill and ST-Link v2 for about 3$. No need for resoldering since resistor was already proper one.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib