1 2 Previous Next 26 Replies Latest reply on Apr 30, 2014 7:41 PM by user_14586677

    Pure assembly language project in psoc creator?

    user_322064261

       At the uni where I work I want to get people onto psocs in the future to replace the PIC micro controllers we use to teach students.

         

      however we need to start with assembly language, just wondered if it is possible to run an assembly only project in psoc creator. 

         

      We would need to be able to step through single instructions and see the ALU flags changing. Z N C etc. would love if this was possible because for C stuff psoc rocks!

        • 1. Re: Pure assembly language project in psoc creator?
          user_1377889

          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.

             

           

             

          Bob

          • 2. Re: Pure assembly language project in psoc creator?
            user_1377889

            By the way: I just remember that in my education we were taught

               

            first FORTRAN

               

            then PL1

               

            then C

               

            and then assembly (all on an IBM mainframe) all in this order.

               

             

               

            Bob

            • 3. Re: Pure assembly language project in psoc creator?
              user_14586677

              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

                 

              things) -

                 

               

                 

              www.cypress.com/

                 

               

                 

              The ap note discusses direct register writes, essentially ASM in another form,

                 

              to raise port pin toggling rates.

                 

               

                 

              Regards, Dana,

              • 4. Re: Pure assembly language project in psoc creator?
                user_1377889

                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.

                   

                 

                   

                Bob

                • 6. Re: Pure assembly language project in psoc creator?
                  user_14586677

                  There is an extensive video library on creating components, configuring

                     

                  UDBs and manipulating Datapath, as well as targeted designs and other

                     

                  topics.

                     

                   

                     

                      

                     

                            http://video.cypress.com/video-library/video/PSoC-Software

                     

                   

                     

                  Regards, Dana.

                  • 7. Re: Pure assembly language project in psoc creator?
                    user_322064261

                     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?

                    • 8. Re: Pure assembly language project in psoc creator?
                      user_322064261

                       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

                      • 9. Re: Pure assembly language project in psoc creator?
                        user_14586677

                        Verilog is HDL used.

                           

                         

                           

                            

                           

                                  

                           

                        http://www.cypress.com/?docID=43232     AN82250

                           

                        http://www.youtube.com/watch?v=9NSdXRHT2po

                           

                         

                           

                         

                           

                        Regards, Dana.

                        • 10. Re: Pure assembly language project in psoc creator?
                          user_1377889

                          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.

                             

                           

                             

                          Bob

                          • 11. Re: Pure assembly language project in psoc creator?
                            user_322064261

                            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.

                            • 12. Re: Pure assembly language project in psoc creator?
                              user_1377889

                              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

                                 

                              State-machines

                                 

                              Counters

                                 

                              Analog signal conditioning

                                 

                              Communication interfaces as I2C, SPI

                                 

                              the end?

                                 

                              Maybe to program a quad- or hex-copter using calman filters

                                 

                              All that is within a PSoC.

                                 

                               

                                 

                              Bob

                              • 13. Re: Pure assembly language project in psoc creator?
                                user_14586677

                                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

                                   

                                end parts.

                                   

                                 

                                   

                                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.

                                   

                                 

                                   

                                Regards, Dana.

                                • 14. Re: Pure assembly language project in psoc creator?
                                  ki.leung

                                   "a quad- or hex-copter using calman filters"

                                     

                                  That is an interesting project.

                                  1 2 Previous Next