PSOC1 and CyFi artaflex problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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.     

   

     

            

0 Likes
1 Solution
Anonymous
Not applicable

 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.

View solution in original post

0 Likes
7 Replies
MR_41
Employee
Employee
First like received

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

0 Likes
Anonymous
Not applicable

 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?

0 Likes
MR_41
Employee
Employee
First like received

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

0 Likes
Anonymous
Not applicable

 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.

0 Likes
MR_41
Employee
Employee
First like received

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

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Thanks. 

   

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

0 Likes
Anonymous
Not applicable

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

0 Likes