- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how can we toggle an led in psoc by writing a single value in control registers and using logic gates? i don't want to toggle it through command
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not quite clear what you exactly mean. Toggling an LED in software is a direct write to the GPIO pin.
A hardware approach usually takes a PWM or a Timer component and connect the appropriate output to the GPIO
A mixture is a Timer component connected to an interrupt. In the handler toggling the LED. I personally prefer that method because this single timer can perform additional jobs at maintaining an internal clock, delays and waits.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not quite clear what you exactly mean. Toggling an LED in software is a direct write to the GPIO pin.
A hardware approach usually takes a PWM or a Timer component and connect the appropriate output to the GPIO
A mixture is a Timer component connected to an interrupt. In the handler toggling the LED. I personally prefer that method because this single timer can perform additional jobs at maintaining an internal clock, delays and waits.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can configure the Control Register to generate a pulse signal. Connect this pulse signal to the clock of a toggle flip-flop. Here is how this would look like:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually the Control Registers output cannot be connected to the Macrocell's clock input of a UDB. So, the 12MHz clock is connected to the TFF's clock input and the Control Register's output is connected to the TFF's clock enable input. As the result there will be a short latency from the rising edge of the Control Registers' output and the TFF's output.
This is an another solution with a same concept.
Both the Control Register's output and the TFF's output are explicitly synchronized to the 48MHz HFClk.