You may write assembly code and easily include that into a C-main() function but the ARM assembly is not easy to learn since some of the instructions are three-address-instructions. The single-stepping can be done in the IDE: When debugging you may open a "Disassembly"-window and step through the code and watch your CPU-state, PC and SP.
Do not forget that the GCC when enabled optimizes the code so that it is difficult even for a good programming guy to beat the code density and/or execution speed.
C-language was invented to have a machine-oriented programming language that will make assembly unnecessary.
By the way: I just remember that in my education we were taught
and then assembly (all on an IBM mainframe) all in this order.
One instructive exercise is to write simple stuff in C, and also in inline
ASM, and compare the results. Compilers are not yet ASM dense/speed,
but getting pretty close.
Here is an ap note that discusses port bit toggling rates (amongst other
The ap note discusses direct register writes, essentially ASM in another form,
to raise port pin toggling rates.
To get you still more exited about PSoCs and the broad design entry they allow:
There is a HDL (Hardware Definition Language) entry to implement new functions. Take the attached project as an example to implement a serial-in parallel-out shift register example. I apologise not having written any documentation, but this was just a proof-of-concept. Open the project, click in workspace explorer the tab "Components" and look into the .v-file containing the verilog text.
There is an extensive video library on creating components, configuring
UDBs and manipulating Datapath, as well as targeted designs and other
Thanks Dana I will check those out. I imagine it's going to take a long while to master his silicon. So many features..
and Bob I know about he programmable HDL components but I haven't tried it yet, they are programmed in Verilog right?
I want to try and implement an RS485 style UART at some point, I don't care about the voltage levels but just the line driving and whatnot. God and I've not even touched the 5LP series yet. That's next on the agenda
For RS485 just use the UART and check the 485-style. You will need some external drivers to maintain current and/or voltage levels.
When I started with PSoCs i went through all the modules from"Analog" to "System" to get an overview of the capabilities (overwhelming, isn't it?) Then I started some smaller examples on my evaluation kits (Yes! I bought some) and got them to work. So I learnt how to use PSoCs.
How long did that take you? What kinda background did you come from ARM? Or PIC or AVR etc? Also after learning it all which architecture do you spend up your most time with for personal projects. 3,4 or 5?
i feel like I am on a long road to mastering both ARMs and PSoCs but it's an exciting one, these chips are just so fun.
I am coming from the programmer's side having learnt a bunch of different languages and a lot of programming techniques. Then I worked for some decades for a distributor of electronic devices learning to read (and understand) datasheets.
I started with PSoC1 and an ICE-Cube(In-Circuit-Emulator)
Then I got me a KIT-001 which works with PSoC1, 3 and 5.
I do not vote for the PSoC3 since the design of the 8051 was made in 1980 and the core reflects the state-of-the-art of that area which in my opinion is a bit (or even a byte) outdated.
PSoC 4 will take over the market the PSoC1 has containing a modern core (ARM M0) and which is VERY cheap ($1 in quantities). Very good for small projects as temperature or light controlling with CapSense.
PSoC5 is my favourite to work with: ARM M3 Core, lots of hardware inside (although fewer analog capabilities than the PSoC1).
Teaching with PSoCs? What do you need and what do you plan?
What are the prerequisites?
Knowledge of a programming language is essential, and it should be C-language. The use of assembly lacks the transportability between different CPU families. C can even be practiced on the PC, algorithms could be evaluated there and later get transferred to the target system.
Hardware, first of all a PC or Laptop for each student (or group of). A Target system can be as small as the new CY8CKIT-049-42xx which is availlable for $4 but lacks debug capabilities if you do not have got a MiniProg3. So the Pioneer development kit ($25) could be the first approach, the Kit-050 ($99) is a very comfortable one, it comes with an LCD.
What to teach?
Starting with simplest AND OR XOR gates building adders comparators and other basic functions
PLD design with the LUT-component
Analog signal conditioning
Communication interfaces as I2C, SPI
Maybe to program a quad- or hex-copter using calman filters
All that is within a PSoC.
Even though PSOC 1 an older proprietary core, 4 MIPS, it has more varied analog
resources than PSOC 4 (33 MIPS), and has pricing in the range of $ 1 - $ 2 for low
PSOC 1 has hi res A/D, sw cap filters, larger array of offerings in digital
and analog block count, CyFi support, powerline, INAMP, DTMF, PGA......
PSOC 4 much better core, cortex, better tool, more flexible routability, better SAR for
fast A/D, timers and counters more flexible, better reference, less overall analog,
32 bit single cycle multiplier........
You have to set datasheets down side by side to get a feel for the differences.
Both families still very much in play.