- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,as below pic,can I set the two pins output at the same time?
I use the command ( Control_Reg_Write() ),it's just can set one at a time.
if it can not set outputs at the same time,have any way to realize it?
and I am not sure about configure mean of control register,does output numbers of the control register correspond to demux output numbers?
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If I can assume that your PSoC 4 has UDB, I would do something like
This way you can set
0: none output
1 or 2 : output one
3: output both
Similarly you can use output port with output enable.
0: none output
1 or 2 : output one
3: output both
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If I can assume that your PSoC 4 has UDB, I would do something like
This way you can set
0: none output
1 or 2 : output one
3: output both
Similarly you can use output port with output enable.
0: none output
1 or 2 : output one
3: output both
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when I connect two input port on line,it will notice error like below picture,
do you know what wrong with it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I just tested with CY8CKIT-044 and it worked as below.
But in your schematic, I'm afraid that the red-highlighted place may not be connected.
Could you double check the connection?
schematic
pins
PWM config
main.c
===========
#include "project.h"
#include "stdio.h"
int main(void)
{
uint8_t mode = 0 ;
CyGlobalIntEnable; /* Enable global interrupts. */
PWM_Start() ;
for(;;)
{
Control_Reg_Write(mode) ;
mode = (mode + 1) % 4 ; /* mode = 0, 1, 2, 3, 0, ... */
CyDelay(10) ;
}
}
===========
The oscilloscope display
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,I also use CY8CKIT-044 and do it with your method successfully
but I still have a question about that why do you set the mode from 0 to 3
as I known,Control_Reg_Write←this command is to write a byte to a control register and your control register just only have two output
- Add to Phrasebook
- No word lists for English -> Traditional Chinese...
- Create a new word list...
- No word lists for English -> Traditional Chinese...
- Copy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> I also use CY8CKIT-044 and do it with your method successfully
I'm happy hearing that!
> but I still have a question about that why do you set the mode from 0 to 3
> as I known,Control_Reg_Write←this command is to write a byte to a control register
> and your control register just only have two output
It was only showing that the method is working,
so the value did not have much meaning.
But I wanted make it explicit that I was controlling only 2 lower bits.
And to show the pattern I wanted to keep the oscilloscope pattern precise and uniform.
For example if I wrote
=============
while(1) {
for (i = 0 ; i < 5 ; i++ ) {
Control_Reg_Write(i) ;
}
}
=============
There will be non linear pattern between i = 3, 4, (and 0).
I'm sorry, but I could not figure out what the following part meant.
===============
- Add to Phrasebook
- No word lists for English -> Traditional Chinese...
- Create a new word list...
- Copy
===============
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The datasheet of the De-Multiplexer component mentions that only one of the output signal is driven based on the select input. Thus it is not possible for the two pins to output at the same time.
According to me the method suggested by moto would be required if you want both the pins to output at the same time.
In the above case, you would require the following setting for control register:
Regards
Ekta