cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous91
New Contributor

Hi all,

I am using a PSOC5 Cy8C5888AXI for a project and have encountered some problems regarding clocks with an external oscillator and with measuring the duty-cycle of a pwm signal.

For the oscillator im using an HC49US8.000MABJ-UB 8MHz crystal unit. I checked XTAL in the clock settings and entered the frequency, accuracy and the capacities as specified in the data sheet. I also checked "Use default startup timeout" and "Halt on XTAL startup error". My problem is that the connected crystal does not work this way. According to the debugger, after switching on I end up in the function CyClockStartupError which means there is an error during clock configuration. I have already tried to increase the timeout time, but this has not led to any change. Is there anything else I have to do to get the external oscillator working? Due to this problem, i tested my software with the internal oscillator of the psoc device.

The second question concerns pwm. Within the scope of the project, an integrated circuit generates a 400 kHz pwm signal from which the psoc is to determine the duty cycle. I know that the frequency of the pwm signal is quite high, but the hardware is already there. I have tried the solution from post https://community.cypress.com/t5/PSoC-5-3-1-MCU/PSoC-5LP-Duty-Cycle/m-p/213916 and for low frequencies it works so far. For higher frequencies or the target frequency, however, it looks like so many interrupts are generated that the psoc no longer leaves the isr and freezes as long as the signal is present. Since I have no more ideas myself and have not found any other working solutions, I would like to ask everyone if anyone can help me with this problem. The workspace is attached to this post. (The other stuff in the project is working as intended)

Thank you for your help.

 

Best regards,

Andreas

0 Likes
1 Solution
Len_CONSULTRON
Honored Contributor II

Andreas,

Let's first try to solve your first issue (Ext Osc @ 8 MHz).

I've attached a modified version of your project that correctly assigns a digital input as the External Oscillator source.

Here's my steps:

  • Added new schematic page in your TopDesign called Ext_Oscillator.
  • Added a new Digital_Input component with a wire trace called EO_8M.
    Len_CONSULTRON_0-1623084221640.png
  • Make the pin assignment for this new input.  For example you can chose P15[0] or P15[1].
  • Changed the System Clocks assignment by
    • deselecting the XTAL check box. 
    • selecting the Digital Signal check box
    • Select the "..." to the right of the Name: field.
    • Selected the EO_8M signal in the "Select source clock" window.
      Len_CONSULTRON_2-1623084478912.png
    • Added "8 MHz" in the Frequency: field.
    • Select "OK" to go back to the "Configure System Clocks" window.

  • Len_CONSULTRON_1-1623084390973.png
  • Select the "Osc"  selection in the "IMO" box.
  • Change the "Input:" field to "Digital Signal" in the "PLL" box.

These changes Application Builds without errors.

Give it a try.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
3 Replies