8 Replies Latest reply on Mar 16, 2015 8:07 AM by user_1377889

    Application data

    niklas.andersson

       Hi!

         

      I’m new to Psoc and in general not the most skilled in embedded programing....but it’s a work in progress.     

       

         

      I would like to build a small control system with capacitive touch for controlling different electronic devices mainly through rs-232.     

       

         

      If i wore to hardcode the application i firmware that would be easy, but i want the user to be able to change the behavior of the system (if for example he byes a new TV) with a simple pc program and fill in the different rs-232 strings and delay between commands and witch button led lights etc and send the configuration via USB to the psoc 5. The psoc will store the configuration in nonvolatile memory and execute parts of it when a button is pressed.      

       

         

      In other words i want to have a firmware that is fixed and able to receive a config and store it and run the sequence when asked for.     

       

         

      iv come up to the following ideas so far:     

       

         
            
      • Let the pc program package the information i fixed length strings and tag each string with a identifier of the content ex. 0x01=string, 0x02= delay, 0x03= blink led etc. followed with the payload ex the RS-232 string. Store the config in onboard EEPROM. Read the button corresponding span of the eeprom and execute it when asked for. Pros: cheep. Cons: might run out of space in eeprom. Limited flexabilite in long string etc.      

         

      •    
         
            
      • add a SD-card and implement a filesystem on the psoc. Send the configuration to the psoc in "plain text" and read the corresponding lines in the file and act on the content when a button is pressed. Pros: human readable. There is room to grow and make a more complex solution. Cons expensive and takes up boardspace that i don’t have.      

         

      •    
         

      Don’t want the user to have to have psoc installed and have read/write axcess to the firmware and compile a new program and bootload. Instead, is it possible (or reasonable) to add a compiler to my custom pc program and let it compile the user config changes and add the fixed firmware and make a new hex file and bootload that in the system? Sounds ehhhh... very hard.     

       

         

      Im hardly the first person who wants a partly reconfigurable userapplication running in a firmware on a embedded system, right?     

       

         

      How is it normally done? Any ideas?     

       

         

      Thanks     

       

        • 1. Re: Application data
          user_1377889

          Welcome in the forum, Nixi!

             

          I am afraid that what you want to do is something for a Raspberry Pi running Linux and not for an embedded system. You may specify your different strings and delays in a file which is red and acted on by your program. An editor and some testing facilities would make that a perfect implementation. The world of embeddeds concentrate more on controlling hardware, closed loops or an espresso brewer. Since the lack of a user-oriented operating system on a PSoC will aggravate your project's realization, so I would suggest to think it over.

             

          The PSoC be it a 4 or 5 will give you other problems to solve and a lot to learn if you like.

             

           

             

          Bob

          • 2. Re: Application data
            user_342122993

            @Nixi,

               

            My understanding is that you asking two separate questions: (i) how to upload fixed format strings to PSoC and save it to EEPROM or flash, and (ii) is it possible to update PSoC firmware without using Cypress Creator IDE.

               

            The first task is surely doable: check this example for saving structured buffers in EEPROM:

               

            http://www.cypress.com/?app=forum&id=2492&rID=105370   

               

             

               

            and another example of receiving structured data through UART here:

               

            http://www.cypress.com/?app=forum&id=4749&rID=105248

               

             

               

            For EEPROM you are limited by EEPROM size which is (2048/4096 bytes), but  you probably can modify it to use emEEPROM to save data in flash, which is ~200kb.

               

             

               

            I have no unswer for your second question. 

               

            odissey1

            • 3. Re: Application data
              user_78878863

              To your second question: yes, but.

                 

              It depends on what you actually want your PC program to do. Should it create C-level code which needs to be compiled? In that case you would need to incorporate at least an ARM gcc (which should be OK license-wise), maybe whole Creator (which I doubt is OK).

                 

              You could also just append the configuration data to the firmware (as kind of data block), which I think can be done programmatically. If you have a USB-bsed bootloader, then this can be used by your PC program.

                 

              Best option would be to use the EEPROM solution. Have your PC program generate a data block consisting a small state machine that describes the actions your firmware should do, and a data block that holds the communications strings. Mybe use an external EEPROM or FRAM, that takes less board space than the SD-Card.

                 

              Oh, and there are C-Interpreters that you could embedd in your code, but I don't know how well they work for embedded software and how much Flash memory they need.

              • 4. Re: Application data
                user_14586677

                SDCARD would give you plenty of R/W storage -

                   

                 

                   

                    

                   

                          http://www.cypress.com/?rID=58694

                   

                 

                   

                Regards, Dana.

                • 5. Re: Application data
                  niklas.andersson

                  Thanks for all your replies.     

                   

                     

                  Interesting reading. C-interpreter sounds interesting, I’ll have to read up on that.     

                   

                     

                  Maybe this is a case of me wanting to much. Il think i have to go back and set the boundary’s for the system and calculate on how big the data block will be. And if it fits in the EEPROM or the emulated EEPROM then this is the solution.     

                   

                     

                  With the emulated eeprom i can use the PSOC 4 but it has the limitation with only 4 UDB so I’m forced to use the SCB also, as i understand has some limitations with fixed pins, i2c and some types bootloading. And to make things worse it has no onboard USB. Locking forward to the new PSOC 4 -L series with USB =)     

                   

                  • 6. Re: Application data
                    user_14586677

                    Here is product roadmap, attached.

                       

                     

                       

                    Regards, Dana.

                    • 7. Re: Application data
                      user_1377889

                      The new upcoming Pioneer Kit-M with a PSoC4 has already an 1Mbit F-Ram on board which can be accessed directli via I2C.

                         

                      Since the PSoC4 has got 128KB flash a menu-driven system using the CapSense facilities could be implemented. Additionally on board is an accellerometer which would be able to detect device moves if that is of any help.

                         

                       

                         

                      Bob

                      • 8. Re: Application data
                        user_14586677

                        Not to be ignored but PSOC 3 has parts as low as ~ $ 3 @ 1000

                           

                        with USB, and with 16 UDB blocks, DelSig....

                           

                         

                           

                        The product selector guides (filterable) for the PSOC families a useful

                           

                        tool.

                           

                         

                           

                        Regards, Dana.