Design Con 2015
Breaking News
Comments
Oldest First | Newest First | Threaded View
Page 1 / 2   >   >>
Max The Magnificent
User Rank
Blogger
Being prodded into action
Max The Magnificent   6/27/2014 3:12:00 PM
NO RATINGS
Hi Aubrey -- I have one each of the PSoC 4100 and 4200 prototyping kits sitting on my desk -- and also a PSoC 4 Pioneer Kit -- your blogs are prodding me into action with regard to using them in one of my hobby projects.

betajet
User Rank
CEO
"volatile"
betajet   6/27/2014 3:48:48 PM
NO RATINGS
Aubrey wrote: ... the compiler had optimized away the dummy memory accesses like cDummy++; ...

Most C compilers let you declare a variable to be "volatile", e.g.,

    volatile int cDummy;

which tells the compiler not to optimize loads and stores to that variable.  "volatile" is mostly used to identify a variable as memory-mapped I/O, which means it could change value any time, e.g., if it's the current value of GPIO pins.  Writes to a volatile variable may have side-effects like shifting data out though a UART pin.  "volatile" is also used for variables that are shared with interrupt service routines or other tasks.

antedeluvian
User Rank
Blogger
Re: "volatile"
antedeluvian   6/27/2014 4:04:56 PM
NO RATINGS
betajet

Most C compilers let you declare a variable to be "volatile", e.g.,

    volatile int cDummy;

which tells the compiler not to optimize loads and stores to that variable.  "volatile" is mostly used to identify a variable as memory-mapped I/O, which means it could change value any time, e.g., if it's the current value of GPIO pins.  Writes to a volatile variable may have side-effects like shifting data out though a UART pin.  "volatile" is also used for variables that are shared with interrupt service routines or other tasks


Thanks for pointing this out. However, it seems to me that I adopted a rather poor and even inelegant method of creating code usage. It would have been better of me to adopt the use of assembly instructions like asm ("nop");

 

KB3001
User Rank
CEO
Debugging
KB3001   6/29/2014 11:49:20 AM
NO RATINGS
Did you consider using Keil MDK for software development especially debugging?

Garcia-Lasheras
User Rank
Blogger
Re: "volatile"
Garcia-Lasheras   6/29/2014 5:12:22 PM
NO RATINGS
@Antedeluvian: The idea has been bouncing around in my head for some time now, but after reading your blogs, I'm completely sure I want to try one of these PSoC devices ;-)

About the ARM code, you have mentioned Keil compiler. Do I need to buy a Keil license in order to work with the PSoC 4 device or everything I need is included in the Cypress toolchain?

 

KB3001
User Rank
CEO
Re: "volatile"
KB3001   6/29/2014 6:42:49 PM
NO RATINGS
@Garcia-Lasheras, there is a free Keil download (from www.keil.com) although it's 32k code size limited. I believe PSoC creator uses keil MDK in the background.

antedeluvian
User Rank
Blogger
Re: Debugging
antedeluvian   6/29/2014 8:46:20 PM
NO RATINGS
KB3001

Did you consider using Keil MDK for software development especially debugging?

No. I stayed within PSoC Creator.

antedeluvian
User Rank
Blogger
Re: "volatile"
antedeluvian   6/29/2014 8:49:28 PM
NO RATINGS
Javi

Do I need to buy a Keil license in order to work with the PSoC 4 device or everything I need is included in the Cypress toolchain?

No you don't have to buy anything. I think there is an option which will improve code density or something like that, but so far I haven't bumped into any limitations (and I have used it on the PSoC5 as well). However you do have to register with Keil.

mithrandir
User Rank
Rookie
That annoying debug issue
mithrandir   6/30/2014 12:14:18 AM
NO RATINGS
Yeah the interrupt bug can be quite annoying, I ran into it several times.

If the interrupt isn't quite as critical for what you want to debug, you can disable breakpoints while debugging in Creator(I remember a little lightning symbol which can disable all global interrupts). Not an elegant solution but can work sometimes.

Moving some of my hobby stuff from PSoC5 to PSoC4 felt like quite a step back for me though. You get so used to any pin anywhere you forget that PSoC4 has a quite a few fixed function pins as well. For the sweet price point though, its well worth the sacrifice.

mithrandir
User Rank
Rookie
Re: That annoying debug issue
mithrandir   6/30/2014 1:11:35 AM
NO RATINGS
Oh and in case anyone is interested(note my shameless promotion here),

http://www.embedded.com/design/real-world-applications/4428811/Building-an-electronic-guitar-digital-sound-synthesizer-using-a-programmable-SoC

It uses PSoC5.

Page 1 / 2   >   >>


Top Comments of the Week
Flash Poll
Like Us on Facebook

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Max Maxfield

Max's BADASS Display: A Comedy of Errors
Max Maxfield
4 comments
Good grief -- where does the time go? I first determined to build my Bodacious Acoustic Diagnostic Astoundingly Superior Spectromatic (BADASS) display way back in the mists of time we used ...

<b><a href=Betajet">

The Circle – The Future's Imperfect in the Present Tense
Betajet
5 comments
The Circle, a satirical, dystopian novel published in 2013 by San Francisco-based writer Dave Eggers, is about a large, very powerful technology company that combines aspects of Google, ...

Martin Rowe

Make This Engineering Museum a Reality
Martin Rowe
Post a comment
Vincent Valentine is a man on a mission. He wants to make the first house to ever have a telephone into a telephone museum. Without help, it may not happen.

Rich Quinnell

Making the Grade in Industrial Design
Rich Quinnell
16 comments
As every developer knows, there are the paper specifications for a product design, and then there are the real requirements. The paper specs are dry, bland, and rigidly numeric, making ...

Special Video Section
The LT8640 is a 42V, 5A synchronous step-down regulator ...
The LTC2000 high-speed DAC has low noise and excellent ...
How do you protect the load and ensure output continues to ...
General-purpose DACs have applications in instrumentation, ...
Linear Technology demonstrates its latest measurement ...
10:29
Demos from Maxim Integrated at Electronica 2014 show ...
Bosch CEO Stefan Finkbeiner shows off latest combo and ...
STMicroelectronics demoed this simple gesture control ...
Keysight shows you what signals lurk in real-time at 510MHz ...
TE Connectivity's clear-plastic, full-size model car shows ...
Why culture makes Linear Tech a winner.
Recently formed Architects of Modern Power consortium ...
Specially modified Corvette C7 Stingray responds to ex Indy ...
Avago’s ACPL-K30T is the first solid-state driver qualified ...
NXP launches its line of multi-gate, multifunction, ...
Doug Bailey, VP of marketing at Power Integrations, gives a ...
See how to ease software bring-up with DesignWare IP ...
DesignWare IP Prototyping Kits enable fast software ...
This video explores the LT3086, a new member of our LDO+ ...
In today’s modern electronic systems, the need for power ...