Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® Software > Keil C51 compiler and PSoC 3

Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Keil C51 compiler and PSoC 3
Moderator:
PRKU

Post Reply
Follow this topic



Keil C51 compiler and PSoC 3

Robert-CY posted on 18 Feb 2011 3:28 PM PST
Cypress Employee
126 Forum Posts

In case somebody does not know, PSoC 3 is based on a C51 core that runs in single cycle execution up to 67 MHz. That is a CPU performance of 67x compared to the original 80C51 running at 12 MHz with 12 cycles / intruction. 

Just for reference, PSoC 5 is based on a Cortex-M3

No device is good without supporting tools that create excellent code. Cypress has teamed up with Keil to provide the best 80C51 C-compiler with the most powerful chip with the 80C51 core on the market. Price for the tool?  IT IS FREE!

You can download PSoC Creator including the Keil C51 compiler from the Cypress website.

You might wonder if there are any restrictions for the compiler and the answer is "Yes"

Yeah, now comes the catch. Well, you can only use this implementation with Cypress PSoC 3 devices and the version is 8.16. The IDE is Creator, not uVision because Creator is what you need to create your own chip.

Hope you like tha fact that you get development tools worth thousands of $$ for free!

If you have any questions about Cypress and Keil, feel free to ask right here in the forum.

Have fun exploring the incredible possibilities that PSoC 3 offers with Creator and the Keil C51 compiler

Cheers, Robert

More information about Keil and PSoC

Keil compiler registration

Keil compiler licensing if one is already installed

Limit of optimization in the free Keil compiler




Re: Keil C51 compiler and PSoC 3

Azlan posted on 21 Feb 2011 08:21 AM PST
Senior Member
12 Forum Posts

 uVision allows setting the code editor font and size where creator does not.



Re: Keil C51 compiler and PSoC 3

marshg1 posted on 07 Mar 2013 01:18 PM PST
Member
5 Forum Posts

The free C51 that comes with PSoC Creator does do some optimization, but it wasn't adequate enough for us so we went ahead and purchased the Keil CA51.  Here is the version that we downloaded from the Keil web page:  C51 V9.51a.  It installs uVision 4.  How do you get PSoC creator to use the C51 compiler in uVision?



Re: Keil C51 compiler and PSoC 3

yfs posted on 20 Mar 2013 05:43 PM PST
Cypress Employee
103 Forum Posts

You can select the compiler from the Project->Build Settings dialog. Pick "DP8051 Keil Generic" from the Toolchain pull-down. Note that you need to do this in every project (a feature to choose your default compiler is on the works).

Picking the compiler from the Build Settings dialog

 

Depending upon where you installed the compiler, you may also need to tell the tool where to find it. In the Tools->Options dialog. Under Project Management / Generic Toolchains add the full path to the compiler.

Setting the location of the generic compiler

Re: Keil C51 compiler and PSoC 3

yfs posted on 20 Mar 2013 05:44 PM PST
Cypress Employee
103 Forum Posts

Here is the image I managed to fail to add to the last post!

 



Re: Keil C51 compiler and PSoC 3

Learn posted on 14 Aug 2013 05:48 PM PST
Member
2 Forum Posts

 I just get Keil license and download and installed the latest version c51v952.exe.

In the PSoc Creator, Tools\Option\Generic Toolchains I put C:\Keil\C51\BIN in DP8051Keil Generic.

But I cannot find C:\Keil\ARM\ARMCC\BIN in my C:\Keil folder

What should I put in ARM MDK Generic ?



Re: Keil C51 compiler and PSoC 3

danaaknight posted on 15 Aug 2013 03:31 AM PST
Top Contributor
4471 Forum Posts

In my installation these paths all empty, looks like a default is in effect.

 

That being said I would think entry should be, based on my distribution, C:\Keil\ARM\BIN

 

Regards, Dana.



Re: Keil C51 compiler and PSoC 3

danaaknight posted on 15 Aug 2013 03:39 AM PST
Top Contributor
4471 Forum Posts

Something about his post does not look right, given this is PSOC 3, which

is not ARM, you might contact author and ask for clarification.

 

Regards, Dana.



Re: Keil C51 compiler and PSoC 3

danaaknight posted on 15 Aug 2013 03:44 AM PST
Top Contributor
4471 Forum Posts

Or contact Robert, thread originator, rtcy@cypress.com, and ask he pass

onto yfs, Mark, include the thread link and ask Mark why he was parametizing

ARM build settings on a PSOC 3.

 

Regards, Dana.



Re: Keil C51 compiler and PSoC 3

zeta posted on 15 Aug 2013 08:41 AM PST
Top Contributor
362 Forum Posts

You will get the C:\Keil\ARM\ARMCC\BIN in your C:\Keil folder when you install the MDK-ARM Microcontroller Development Kit. You could buy a licence or download the lite version.

In the mean time just leave it as it was by default.



Re: Keil C51 compiler and PSoC 3

Learn posted on 15 Aug 2013 09:16 AM PST
Member
2 Forum Posts

 Since my installed folder Keil do not have ARM sub-folder so that I leave this path not selected.

When I compile Creator sample project :Music_Creation, It generate 151 errors: something like:

 L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _iAP2_SendPacket

 

How can I resolve these errors? 



Re: Keil C51 compiler and PSoC 3

Bob Marlowe posted on 15 Aug 2013 11:03 AM PST
Top Contributor
3950 Forum Posts

Robert left Cypress one year ago, better try to find someone else or file a technical case.

 

Bob



Re: Keil C51 compiler and PSoC 3

Nick_Danger posted on 08 Aug 2014 09:28 AM PST
Top Contributor
80 Forum Posts

Hi,

I suspect I am having a problem with how the Keil is managing memory on a PSoC 3 using Creator 3.0.

Who should I contact?

Thank you,

Nick



Re: Keil C51 compiler and PSoC 3

Bob Marlowe posted on 08 Aug 2014 09:34 AM PST
Top Contributor
3950 Forum Posts

@Nick

If you do not (want to) file a technical case, ask your question, maybe I can help you. I am much older than the 8051 design, so I may know something about.

 

Bob



Re: Keil C51 compiler and PSoC 3

Nick_Danger posted on 08 Aug 2014 01:50 PM PST
Top Contributor
80 Forum Posts

Bob,

Thanks. I have a module that I place all my global variables in with little regard for data type and the order in which they are listed. Already quite a lot of values. I'm up around the 84% FLASH and 52% on RAM usage. I placed a new UINT16 and began having other UINT16 variable that are updated ADC readings began getting stomped on. I removed the variable but it didn't fix the problem. I had to drop back to a previously archived version to get the product to work again. I then tried renaming the variable and placing it next to the variables that were getting corrupted and it solved the problem.

I need to understand if there is some issue with byte boundaries or a preferred order for declaring variables. Do I lump all the 8 bits together, all the 16s together etc?



Re: Keil C51 compiler and PSoC 3

Bob Marlowe posted on 08 Aug 2014 02:43 PM PST
Top Contributor
3950 Forum Posts

Usualy compiler-errors concerning variable allocation are VERY rare. There is no known issue with 8 and 16-bit wide variables or the order in which they should be declared.

Main source of issues are

-Bad pointers

-Busted stack

-Ignored warnings

You may set a breakpoint to find out from where a variable gets clobbered (access write)

 

Bob



Re: Keil C51 compiler and PSoC 3

Nick_Danger posted on 08 Aug 2014 04:57 PM PST
Top Contributor
80 Forum Posts

Busted stack sounds interesting.If I'm writing C code, how would I have influence the stack operations? Would that be from being too many subroutines deep?

When we moved to Creator 3.0 with the Keil C99 update, my code had several hundred data type warnings which I cleared up completely through recasting.

I will try some break points and maybe I can trap it. and view the address in the XData memory window. I don't see any absolute listings for my code. There are list files for all the Cypress generated code but not my code. Am I missing something?

 



Re: Keil C51 compiler and PSoC 3

Nick_Danger posted on 12 Aug 2014 05:28 PM PST
Top Contributor
80 Forum Posts

This is just very strange. I set a break point and started poking around in memory to see how the variables are structured. I see that const strings are randomly interspersed with integers used to store voltages. It doesn't surprise me that items could get stomped on. I haven't had to go this deep in a long time but I don't recall things being this random. Is there a compiler preference that might places memory in an order similar to earlier versions of the Keil? Something is fundamentally wrong and it's impeding our development.



Re: Keil C51 compiler and PSoC 3

Bob Marlowe posted on 13 Aug 2014 10:24 PM PST
Top Contributor
3950 Forum Posts

Stack:

Du to the (very) old design of the 8051 core the processor only has got 256 Bytes of stack. This is used only for the return-addresses of function calls and not for parameters as would have been done usually.

 

You name "const strings"

Afaik strings can reside in flash  when declared with CYCONST and will not be intermixed with variables.

 

There is a final .map-file that shows all variables, functions etc with their associated addresses.

 

To ne honest: I abandoned designing for PSoC3 and I use PSoC5 instead. The reasons are: (much) more modern core, faster core and no restrictions.

 

Bob



Re: Keil C51 compiler and PSoC 3

Nick_Danger posted on 13 Aug 2014 09:14 AM PST
Top Contributor
80 Forum Posts

Bob, thanks for the input. I will indeed try the CYCONST. I would love to abandon the PSoC3 but the hardware designer won't take the plunge while we still have 10K of code space left.

In further experiments I discovered that ONLY my ADC readings were getting corrupted and my preliminary conclusion is that I have to allow more time for the ADC to do whatever it must to present the last conversion for reading. In my code, I start a conversion and then poll the conversion complete flag before I read. The hardware designer's test program simply waits for a long fixed period of time and never has a problem, which I can't do because our product will go into a customer's machine and live on an RS485 network.

In my program, I removed a call to a routine just after my call the ADC routine and began having the problem.This suggests a time issue. I replaced the call with a CyDelayUs(5) and began doubling that parameter until the problem stopped. There are a number of ways for me to lengthen the time. The bad readings cause alarms to trip and I've noticed that if I clear the error in my code, I force a one second delay and the problem stops. I should take this back to the other thread now that I have a clue that it may be a timing issue with the ADC.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 06/15/20