kiml / PSOC_compiler

Tutorial/starter code for setting up GCC for PSOC5 (ARM) in an open-source baremetal configuration.
Other
33 stars 6 forks source link

A wish: Minimal Cypress-Free "demo2a" for PSoC4 #3

Closed Mecrisp closed 7 years ago

Mecrisp commented 8 years ago

I am very glad that you conquered the PSoC5 completely bare-metal, without config and without Cypress parts, and I wish to do exactly the same for a CY8C4245 for porting my native code Forth compiler, Mecrisp-Stellaris, to it. I tried hard to switch a wire, but I did not suceed - I suppose that I might have missed an essential register or two:

minimal-psoc4.txt

May I kindly ask you if you could help with a "demo2a" for Psoc4 ?

Best wishes from Germany, Matthias Koch mecrisp.sourceforge.net

lowfatcomputing commented 8 years ago

Hello Matthias,

Page 6 of this document has some assembly language snippets for toggling pins on the PSoC5 and PSoC3:

http://www.cypress.com/file/141051/download

@ Load register address (PRT0_PRT)
ldr r2, =0x4000510A
@ Set drive mode
mov r3, 0x0C
@ Store drive mode in register
str r3, [r2]
@ Load register address (PRT0_DR)
ldr r2, =0x40005100
@ Set pin data
mov r3, 0x01
@ Store pin data in register
str r3, [r2]

I think you need to set the drive mode to 0x0C for STRONG output to drive an LED. I don't have a PSoC4 but I think it's the same just check the the register maps.

I used this FX2LP board with my PSoC 5LP Schmartboard because this post says there are some strict timing requirements so not all JTAGs will work.

Since then a $10 PSoC 5LP board has been made available with a built-in programmer. I think this PSoC 5LP board is similar to your PSoC4 board if I remember correctly. I don't have one though and I'm not sure what kind of hardware this new 5LP board's programmer has.

Best Regards, Andreas Wagner

Mecrisp commented 7 years ago

Finally, here comes the minimal bare metal blinky for PSOC4.

Cypress-Blinky.zip

Many thanks to Richard Klingler.