Q&A With PSoCDeveloper's First PSoC Master
Ganesh Raaja (graaja) was the 24th user to register at PSoCDeveloper. Since that time Ganesh has maintained a very high activity level on the forums helping both new comers to PSoC and engaging in expert level discussions with other users about the details of PSoC.
Ganesh’s consistent involvement at PSoCDeveloper stands out in the community and has earned him the rank of PSoC Master. The rank of PSoC Master is the highest technical rank at PSoCDeveloper and recognizes significant PSoC technical achievement on the part of the member. Ganesh is the first user at PSoCDeveloper to earn the rank of PSoC Master.
Although Ganesh is widely known in the PSoCDeveloper forums for his PSoC knowledge and willingness to help others PSoCDeveloper thought that users might want to know more about this important player in the PSoC community. The following is question and answer session between PSoCDeveloper and Ganesh Raaja.
PSoCDeveloper: You have been a long time member of PSoCDeveloper. How did you first find out about the PSoC micro chips?
Ganesh: First of all, thank you for the kind words and for enrolling me in the "PSoC Master" rank. I feel honored and excited. It has been a pleasure to be a member of the PSoCDeveloper community, where I am able to interact with many experts in the field, some of them who are experienced in this field for decades. I should thank you for creating such an opportunity.
I first came to know about PSoC when I was looking for a controller with analog resources for a panel meter for one of my customers. Unfortunately the customer dropped the plan for the meter. But I got interested in the new PSoC architecture and bought the development kit just to learn the new technology. Then I got more and more involved with PSoC so that I have not used any other micro for the past 3 years.
PSoCDeveloper: Voluntarily answering questions on the PSoCDeveloper forums has helped many PSoC developers, but, what is your full time job?
Ganesh: I am a freelancing R&D engineer. I develop controllers for industrial applications. After I started PSoC, I got a chance to work for Cypress in different PSoC projects. Now I spend my full time for Cypress projects. My work includes answering Customer questions in Tightlink, conducting PSoC seminars and training programs in India, and working on various PSoC projects for Cypress.
PSoCDeveloper: Many engineers have come from other embedded architectures what embedded experience did you have before PSoC?
Ganesh: I had worked about 1 year with 8051 in some of my projects for industrial controllers, when I came across PSoC. After that I have not used any other controllers in any of my projects. Apart from this, I have taken part in some of the Circuit Cellar contests using Motorola, Zilog, and Renesas controllers, but, my exposure to these controllers was only for the duration of the project I did for the contests. So, I would say that my experience in the embedded field is very limited indeed and I am still in the learning process.
PSoCDeveloper: What recommendations do have you for engineering college students if they are interested in embedded design?
Ganesh: I am not experienced enough to give good guidance specific to embedded design. So, my short recommendation is: "Hard work, hard work, and hard work. There is no short cut to success.”
PSoCDeveloper: I couldn’t agree more that you often get out of something what you put into it. Runner’s talk about the wall, a point at which they can go no further. In your PSoC development experience what are some examples of walls where hard work was needed to overcome the obstacles?
Ganesh: The initial stage of the psoc learning curve was very crucial. I used to lock myself in my lab, nothing hi-tech just A room in my house with a PC and a simple workbench, coming out only to eat and sleep. Now that I look back, that initial one month has paid me very rich dividends. I have seen many people starting with PSoC but after a week’s work, find it difficult and drop it. My request is to have patience and persistence and these two are sure to pay you back. There are a lot of great things that can be done with PSoC.
The biggest wall that I faced was the LMM (Large Memory Model). While working on LIN 2.0 protocol, I had to write all the code in assembly for efficiency. It took me about a week and a lot of sleepless nights to understand the finer points of paging. I had to go through the LMM app note many times and also had to study the PSoC’s User Module code to understand it completely before I was able to remove all the bugs that I had introduced in the program. But that one week’s hardwork was really worthy. Now, assembly programming in LMM no longer bothers me.
PSoCDeveloper: Ganesh, you have been around long enough to see changes to PSoC Designer and the introduction of PSoC Express. What are your thoughts on how the PSoC tools have developed and where they need to go?
Ganesh: Regarding PSoC tools, I am not very familiar with PSoC Express, though the concept is very revolutionary. Maybe I would dedicate some time in the future to learn this great tool. As far as the PSoC Designer goes, it is an excellent tool and the growth in the tool has been tremendous, be it addition of new devices or addition of new User Modules, PSoC Designer has come a long way from the version 3.1, the version I first used. One drawback though is the efficiency of the Image Craft C compiler. That too after introduction of LMM (Large Memory Model), the efficiency has become very poor. But, this could also be attributed to the paging architecture of the PSoC itself.
PSoCDeveloper: Other users have commented on the efficiency of the Image Craft C Compiler and the Large Memory Model. Given that these are issues of the CY8C2xxxx series PSoCs that must be managed what advice can you give users to make the most of the Image Craft compiler and the PSoC’s LMM.
Ganesh: There is not much we can do to circumvent the compiler’s inefficiency, other than following some programming practices like avoiding case statements, avoiding use of structures, unions wherever simple globals can be used etc. These tips have been proposed by many experts in various PSoCDeveloper threads.
My personal favorite is to use hybrid programming. Wherever possible, write functions in assembly and make them callable from C using fastcall16 convention. This way you will have control on the page switches and you can keep these to minimum. Also, write ISRs in assembly. The C compiler saves all virtual registers, and page registers to the stack before entering an ISR and restores them when exiting the ISR. In a complicated program, the number of registers pushed and popped may go more than 10. When you do the ISR in assembly, you will only save and restore the registers that you know are modified. Of course, when you want to pursue this course you have to be thorough in assembly programming and also have to get accustomed to the paging operations of the PSoC. If you overcome the initial roadblocks in paging, handling paging in PSoC is not that difficult as it seems to be.
PSoCDeveloper: With more than 1,000 posts at PSoCDeveloper you have become familiar with common struggles of new comers to PSoC. What suggestions can you make to those that are just coming up the PSoC learning curve.
Ganesh:
- Do not compare the internal resources of PSoC with general analog or digital functions. That would limit your resourcefulness of using the PSoC’s very flexible resources. Go through the Technical Reference Manual (TRM) to understand the details of the internal resources like Analog CT blocks (Continuous Time), Analog SC (Switched Capacitor) blocks and digital communication blocks. With enough understanding of the internals of PSoC, it is possible to do many wonders which may not be possible with a conventional micro.
- It may be a bit difficult to get familiar with the concept of User Modules, APIs, etc. The best would be to start with the pre-recorded video modules and the teletraining modules available at the Cypress website.
- There are many useful application notes written by analog experts that will demonstrate the ways to exploit the PSoC’s resources. Some of the notes are AN2028, AN2041 (my favorite), AN2044, AN2086, AN2095, AN2122, AN2145, AN2168, and many more. Going through these app notes and their associated projects will get you more familiar with the internals of PSoC and will help you in achieving your results in more unconventional ways. To quote one of the PSoC experts at Cypress, "Hook it up first. Then worry about how well it works".
- Sometimes, you may get stuck with a particular problem for which you are not able to find a solution. You work late into the night and get more and more desperate and the problem does not get solved. The best solution at such times is to just switch off and go to bed. Do not work on the project for a day. On the second day, you will be surprised to find that the problem was something very simple and you would be able to fix it in a couple of minutes. You may even hit yourself on your head for having overlooked such a simple problem.
- The above points should get you going with your projects. If you get stuck with some problem for which you do not have an answer, there is always PSoCDeveloper.com to your rescue. There are experts in many fields all around the world who are willing to help.
PSoCDeveloper: Some users may not be aware that in addition to the excellent help that you have provided users at PSoCDeveloper you have also written several application notes for PSoC. This link will search the App Note data base at PSoCDeveloper for Ganesh's application notes.
PSoCDeveloper: What are your hobbies Ganesh?
Ganesh: Reading is one of my favorite hobbies. I like thrillers (Alistair Maclean, Robert Ludlum, Dan Brown etc), Science Fiction (Isaac Asimov, HG Wells, Robert Heinlin etc), Agatha Christie Mysteries and Perry Mason novels.
My other hobby is singing and playing my guitar (and of course scaring my neighbors ;)). The songs I love to sing are Bachelor Boy by Cliff Richard, Tears In Heaven by Eric Clapton, Hello by Lionel Richie and Sound of Silence.
PSoCDeveloper: Ganesh, current PSoCs are all 8-bit micros with similar digital and analog capabilities. There have been rumblings of more power PSoCs. If you were to define a revolutionary jump in PSoC technology how would you like the chips to change?
Ganesh: In my limited experience with industrial controllers, I have never needed anything more than the 8 bit micro that the PSoC has. But with the analog resources that the PSoC has, it would be great to have a 16 bit or 32 bit micro with hardware floating point operations so that PSoC can be easily used in DSP applications. If possible, I would convert the 2K RAM address into a linear address without all those paging registers, which would make the 8 bit micro itself more powerful.
PSoCDeveloper: Ganesh, as a PSoC Master is there anything else you would like to share with your fellow PSoC developers?
Ganesh: I would like to first of all thank MrZee for being my inspiration. I had seen many of his postings in the Cypress forums when I had started with PSoC and was really inspired by his willingness to help others. I have only tried to follow his example. I have been gaining a lot of experience in embedded field from many great contributors at PSoCDeveloper. I would like to thank great contributors like Bill Lovell (lovell), Paul (wrightpc), Idiod, Werner from whom I have learnt a lot in this field. And most importantly, I would like to thank you Eric (ericb), for excellently maintaining this site, and making it possible for all PSoCDeveloper users to share their ideas with others. And I would like to thank all PSoCDevelopers who have posted many interesting and intriguing questions in the forum. I have learnt a lot of new things from these questions.
PSoCDeveloper: Thank you Ganesh for taking the time to share your thoughts with me and the PSoCDeveloper community. Again thank you for your generous contributions to PSoCDeveloper. I'm sure I speak for many here at PSoCDeveloper when I say I look forward to your next 1,000 posts.