Control Register (logical) error in PSoC 5

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

I use the PSoC 5LP CY8C5868AZI-LP035 to generate a 3 phase sine wave with 3 external DACs with an SPI interface. So, as suggested in the documentation, I have a firmware controlled setup where i enable each DAC when required. 

   

I use a 3bit Control register and the problem is that i am not able to activate each line in sequence, ie, CR_Output1, followed by CR_output2, ending with CR_Output3. I can do so, however, when i give a certain delay between their enabling, but when i do so without any delay, the 3rd output selects when im actually selecting the 2nd output and vice versa. 

   

So, to enable them, the input to the API is,

   

0x06, 0x05 and 0x03, this should lead to Line1, Line2 and then Line3, but what happens is: Line1, Line3, Line2.

   

So i have to exchnge the input as: 0x06, 0x03 and 0x05, which somehow works, and i dont know why.

   

Any help would be appreicated.

   

Thanks in advance.

   

PRP

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I ran your project on a CY8CKIT-059 PSoC5 prototyping kit and all is OK.

   

Check your wires. See attached project and screenshot.

   

 

   

Bob

View solution in original post

0 Likes
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I would try to set the line containing

   

            Master_Start();     //DAC 1 OUTPUT

   


before writing to the control register.

   

Is it really required to start and stop the SPIM?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

I have removed the SPIM start API call and used it only once in the initialization. I don't turn it off and on again and the error still exists.

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I ran your project on a CY8CKIT-059 PSoC5 prototyping kit and all is OK.

   

Check your wires. See attached project and screenshot.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob, 

   

I tried the changes in the code and I am still getting the wrong result. I will look into the PCB and other hardware details to check if i have everything right. I'll get back soon. Thanks for your help. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I am definitively sure that you swapped two of your signal lines. No act at all to swap them one more time in the pin assignment.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

I double-checked the schematic and traced out the pins on the PCB. They are correct. If I try selecting the control register outputs one at a time (in a separate program) on the same board, they work fine. I have not been able to understand why this is so. It's left me even more confused. 

0 Likes

can you share your schematic of custom board.if that is not possible can you cross check it with schematic of CY8CKIT-059

0 Likes