- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm a PSoC newbee and just tried out the WaveDAC8 example. I was able to connect the on-board switch via the input Pin P2.2 to the wave select input and the system outputs one of the 2 specified waveforms (sine or triangle) depending on whether the button is pressed or not.
Then I connected a comparator to the output of the DAC (positive input) and a 0.256V Vref at the negative input. The output of the comparator is connected via output pin P2.1 to the on-board blue LED.
Unfortunately the comparator output doesn't toggle at all, but stays low (LED off) although the DAC voltage definitely crosses the 0.256V threshold during each period.
At a DAC waveform output frequency of 1kHz the comparator should be fast enough.
When I use the inverted mode of the comparator, the output remains high (LED on), so at least the connection from the comparator output to the pin seems to work.
In the analog schematic I see that the DAC output signal goes via an OpAmp to the pin P0.0 and is then fed back to the positive input of the comparator.
So all seems OK, but still the comparator seems to be not working.
Does anyone have an idea what could be wrong?
Thanks,
Gerhard
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Tags:
- psoc 5lp comparator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please post your code by clicking on File then Create_Workspace_bundle. So we can see your code and schematic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You forgot to start the comparator: Comp_1_Start();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for this hint. I was not aware, that I have to start the analog components. I thought, these hardware components are just "on" when the system has powered up (just like a kind of analog FPGA).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have changed your program. Your PRF (Pulse Recurrence Frequency) was too high so your display always looked like the LED was on. You forgot to start the Comparator in your code and I changed the port where you connected the voltage reference . You may want to look at this Precision Illumination Signal Modulation (PrISM) component it is made for this application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot for your help. I observed the LED not only visually (I expected it to change brightess because of different on-time during the period - which it finally does - however only a bit...) but I checked it also with a scope, so the high frequency is not a problem. Anyway, after starting the comparator, the PSoC does what I would have expected.