Status Register Read signals

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

cross mob
Anonymous
Not applicable

Greetings,

   

 

   

Im starting to learn programming PSoC 5 and i'm blocked in one functionality. Maybe you guys can help me.

   

The test i made is trying to read the status signals from the StatusRegister hw block. I can read polling the signals and send the values to uart-usb console just fine.

   

If i use same StatusRegister, configured as Generate Interrupt and in consequence i enable interrupt api too, using the same status signals read api, i get no result.

   

 

   

The idea i want to implement is:

   

Store 4 digital signals in the StatusRegister, once i have one of them at high level, generate an interrupt and read the status signals of the register and decide what to do depending on this value.

   

 

   

Thanks in advance!

   

BestRegards.

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

No need for ORing, the status register is able to create an interrupt. As the datasheet says you will need to call StatusReg_WriteMask() and StatusReg_InterruptEnable() to setup the component.

   

 

   

Bob

View solution in original post

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

Welcome in the forum.

   

Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can OR the 4 signals together, and use the result as trigger for the interrupt.

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

No need for ORing, the status register is able to create an interrupt. As the datasheet says you will need to call StatusReg_WriteMask() and StatusReg_InterruptEnable() to setup the component.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi,

   

Thanks for the comments.

   

I tried this method but if i have 4 status signals and in the initial case of configuring the int mask for all of them.Once i have one signal active at high, the interrupt its triggered.

   

Afterwards, in the ISR function, i must configure for each status bit, the corresponding interrupt mask and then, wait for another interrupt trigger in order to know which of the status bits was really changed.

   

Thanks,

   

BR

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

But with the OR you don't get as many interrupts (only when the actual result changes, but not necessarily for each pin change)

0 Likes