7 Replies Latest reply on Apr 29, 2011 1:01 AM by content.librarian

    PSOC1 and CyFi artaflex problem

    yair.koletker

       Hello all.     

       

         

      I know that this isn't the first time this topic is talked about here. but I did everything that was written in the forums and application notes and still can't make it work.     

       

         

      I have a CY3210-PsocEVAL1 kit and an artaflex awp24s Cyfi module, working on the Psoc Designer 5.1.     

       

         

      Because the artaflex requires a 3.3v operation voltage I'm working on the Psoc with an external voltage source and using the built in VRM (U3) on the Psoc to supply the board and artaflex with a 3.3v Vcc. The CPU_clock is set to SYSCLK/2=12Mhz, VC1=SYSCLK/2 (12Mhz), VC2=VC1/3 (4Mhz).     

       

         

      In the designer I used the CYFISNP module and selected the HUB with GPIO IRQ. I connected all the required ports and VC2 (4Mhz) as the clock to the CYFISNP module and from the ports to the artaflex module.     

       

         

      In all the tutorials and code examples I have seen all start with a loop to start the CYFISNP protocol:     

       

         

      while (CYFISNP_Start()==0)     

       

         

      {     

       

         

      "do stuff, or wait......"     

       

         

      }     

       

         

      and only when this loop expires, that means the CYFISNP has been successfully initialized they continue in all the other routines like Binding, RX pooling etc.     

       

         

      My problem is in that loop for initializing the CYFISNP protocol, when I run this command (CYFISNP_Start()) even once it doesn't return any value, it's just get stuck in that command and the Psoc freezes. When I check the nSS, MISO, MOSI, SCK lines with an oscilloscope i see an activity for some time, about 24 clock cycles (SCK), about the same MOSI write activity and nSS, and 3 MISO activities, one after 2 SCK cycles and 2 some where in the end of the 24 clock cycles i mentioned.     

       

         

      What am i doing wrong? it's supposed to be a simple and friendly protocol.     

       

         

      Please any help would be appreciated.     

       

         

           

                  

        • 1. Re: PSOC1 and CyFi artaflex problem
          graa

          Have you enabled the GPIO interrupt in your code?  Is the IRQ pin configured for the correct interrupt type? The GPIO interrupt could be very important for the CYFISNP to complete initialization.

          Best Regards,
          Ganesh
          The PSoC Hacker

          • 2. Re: PSOC1 and CyFi artaflex problem
            yair.koletker

             I enabled the GPIO, if you mean the "M8C_EnableGInt" function in my main. 

               

            IRQ pin is set to be:

               

            - Select: StdCPU

               

            - Drive : High Z

               

            Interrupt: Rising Edge

               

            Initial Value: 0

               

            Do I need to write a code behind the IRQ interrupt?

            • 3. Re: PSOC1 and CyFi artaflex problem
              graa

              M8C_EnableGInt is to enable global interrupts.  To enable GPIO interrupt, you need to use:

                 

               

                 

              M8C_EnableIntMask (INT_MSK0, INT_MSK0_GPIO);

                 

               

                 

              This will enable the GPIO bit in the INT_MSK0 register and will enable the GPIO interrupt.

                 

               

                 

              Best Regards,

                 

              Ganesh

                 

              The PSoC Hacker

              • 4. Re: PSOC1 and CyFi artaflex problem
                yair.koletker

                 I did that and still the same, the function CYFISNP_Start(); still don't return any value.

                   

                I have 2 artaflex modules, i switched them to check that it's not a problem in the CyFi module.

                • 5. Re: PSOC1 and CyFi artaflex problem
                  graa

                  Let me try to get some CYFI expert to have a look.  Can you zip and post your complete project?

                     

                   

                     

                  Best Regards,

                     

                  Ganesh

                     

                  The PSoC Hacker

                  • 6. Re: PSOC1 and CyFi artaflex problem
                    yair.koletker

                     Thanks. 

                       

                    In the zip file there's the project and a txt file that explains my interconnect to the artaflex and the psoc1 ports

                    • 7. Re: PSOC1 and CyFi artaflex problem
                      content.librarian

                      Hi,

                         

                      I see that you have not reserved flashblock as "Unprotected" in your flashsecurity.txt file to store the CYFI network parameters. One of the activities that takes place in CYFISNP_Start( ) function is storing the network parameters in flash and for that you need to make some flash blocks as "Unprotected" so that the firmware can write data into it. It is recommended that you reserve the last few blocks in your flash area to store the network parameters.

                         

                      The flashsecurity.txt file must be edited to allow Flash writes to the flash blocks. There is one ASCII character in flashsecurity.txt for each flash block of the device. The valid options for this ASCII character are 'W', 'R', 'U', and 'F'. The ASCII characters in this file define the Flash security settings that are applied to each flash block. A 'W' fully protects the Flash block from any writes and is the default setting. To allow the CYFISNP User Module to read and write blocks the protection option should be changed to 'R', 'F', or 'U'. For this project, chnage to 'U'. To properly change the security settings in flashsecurity.txt, delete the character corresponding to the Flash block to be affected. Type in a new character corresponding with the desired security setting.
                      Save the project and rebuild it to ensure that the changed settings have taken effect.

                         

                      Regards,

                         

                      Anitha