UDB input from CPU registers

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

cross mob
Mrinal
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

 Hello!

   

In Psoc4-4200 devices, is it possible to route the output of CPU registers to the input of logic gates?

   

In my case, the CPU generates an 8 bit number and I need to transfer those bits to the input of a few logic gates. How to go about this.

   

Thanks!

0 Likes
7 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Certainly a Verlog solution would accomplish this.

   

 

   

Another way would be a DMA process to a control register.

   

Only usable with PSOC 4 M family, soon to be released.

   

 

   

Some questions -

   

 

   

1) Is your gate destination simple gates like you would implement with

   

Creator gate components ?

   

2) Rate you need to do the update ?

   

3) Need to only update on change ?

   

4) CPU generated value is under SW control, right ?

   

5) What triggers the generation of the 8 bit value ?

   

 

   

 

   

Regards, Dana.

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

The control register component could be used as a first approach. You may wire the outputs to your logic and a simple Control_Write() will set all its outputs simultaneously.

   

 

   

Bob

0 Likes
Mrinal
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

Thanks everyone for the reply! 

   

Danaaknight:

   

The logic gates are simple gates like AND gate and OR gates that are available in psoc creator.

   

The CPU must accept values from the ADC. And then perform some operations on the data. After the CPU's job is done, it must send that data to the input of logic gates, perhaps by storing it in a registor wich is accessible by the logic gates for reading purpose.

   

Level or edge, both types of triggering will suffice.

   

 

   

Bob

   

I just looked at the datasheet of the satus and the control register components in psoc creator.

   

Unfortunately, I do not quite understand the difference between the two.

   

As far as I can understand....

   

1. The CPU can store data in the control registers by calling the ControlReg_Write() function.

   

2. The input of logic gates can be connected to the control register physically and thus logical operations can be performed continuously on the data present in the control register.

   

Please correct me if m wrong.

   

Also, what is the function of the status register? 

   

Can we write the OUTPUT from logic gates to a register, so that the CPU may read it?

   

Thanks again!

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

Reading logical signals is exactly what the status register is for. The control register is an output while the status register is an input.

   

 

   

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Can I re-formulate the question: is it possible to "write" values from CPU to simple logic bypassing use of the Control Register component? For eample, setting bit value directly to an output pin is possible without using ControlReg.

   

The reason for asking is that each ControlReg consumes one UDB, which may not be a problem for PSoC5, but PSoC4200 has only 4 UDB, and PSoC4000 has none. 

   

odissey1

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

For eample, setting bit value directly to an output pin is possible without using ControlReg.

   

 

   

Yes, in code you can set/clear bits, see GPIO section of System Reference in Creator help,

   

or take a look at -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=93401     AN86439 - PSoC® 4 - Using GPIO Pins

   

 

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The control reg does not consume the whole UDB, from datasheet -

   

 

   

Resources The Control Register component uses one control cell in the UDB array

   

    

   

          

   

 

   

http://www.cypress.com/?rID=69774     AN82156 - PSoC® 3, PSoC 4, and PSoC 5LP - Designing PSoC Creator™ Components with UDB Datapaths

   

 

   

 

   

Regards, Dana.

0 Likes