Member Contributions & Content
Browse the Community
Code Examples
Community Translations
Recent discussions
Hi,
Provided below is a custom implementation of analog Phase-Locked Loop (PLL_scm).
Component implements Phase-Frequency Detector (PFD) as phase comparator and voltage-controlled oscillator based on switched-capacitor delta-sigma modulator. Only few external capacitors and resistors required for low-pass filter. PLL_scm can lock to digital signal, producing one output of the same frequency, and another one of multiplied frequency, both are phase-aligned with the input. The component was designed to operate at low frequencies (10Hz–10kHz), with primary goal of tracking AC power lines (50-60 Hz).
Component was developed as part of RMS detection project. It can be useful for frequency multiplication, quadrature generation, motor control, guitar sound effects, etc.
It was tested using CY8KIT-059 PSoC5 prototyping kit. Several demo projects are provided.
Component Major features:
Implements analog PLL using Type-II Phase Frequency Detector.
Uses 1st-order delta-sigma modulator as VCO.
Primary output is locked in both frequency and phase.
Secondary output for multiplied frequency.
Output for optional lock detection.
Does not consume CPU.
Attached archive contains component library, component datasheet and several demo projects for PSoC5. Please read installation instructions in the readme.txt.
The component provided as-is, no liabilities. It is free to use and modify.
YouTube video showing component in action:
Custom Phase Lock Loop (PLL) demo using PSoC5 microcontroller - YouTube
regards,
odissey1
Figure 1. Project schematic using 3-rd order LPF.
Figure 2. O-scope snapshot: blue trace - PLL input (60Hz), yellow trace - PLL output (locked).
I've been trying to recreate my adruino project on the Pioneer kit, and have been struggeling with using my ultrasonic sensor. I tried to follow this:Ultrasonic Distance Sensor HC-SRO4 but ended up with nothing in my .cysch and a lot of errors(because of this, I assume). I would appriciate help with getting this sensor working, I have lots of adruino experience but very little with the whole Cyprus kit.
Thanks!
Show LessWe have more than 300 Code Examples on the Cypress’ GitHub account, https://github.com/cypresssemiconductorco. You’ll find 30 repositories, containing Code Examples for PSoC, BLE, FRAM and many more.
If you are designing with PSoC 6, we have repositories providing Code Examples and Demos for PSoC 6 MCU based RTOS Designs, Audio Designs, Analog Designs, Digital Designs, BLE Connectivity Designs, System-Level Designs, PSoC 6 Pioneer Kit Designs, Device Related Designs.
If you are developing projects with our PSoC4, we recommend you to check out our PSoC 4 repositories. PSoC 4 repositories provide Code Examples and Demos for BLE Connectivity Designs, Capacitive Touch Designs, Digital Designs, USB Connectivity Designs, Device Related Designs, PSoC 4 Pioneer Kit, System Designs, Analog Designs.
Check out BLE Code Examples at PSoC-4-BLE, EZ-BLE_PRoC_Module.
Are you new to PSoC or WiFi or Bluetooth? On Cypress’ GitHub account, we have Code Examples from our 101 classes for you.
Head over to the Cypress’s GitHub account today and clone codes where you need them. If you are new to the GitHub, check GitHub Help Page.
Show LessHi everyone!
I want to share this project I'm working on using a CY8CKIT-050 (PSoC5-LP) to integrate a SSD1963 Solomon LCD controller and a XPT2046 Touch controller with uGUI library. I builded the SSD1963 and XPT2046 drivers and it's working very well.
I created this project because there's not or really few information about this LCD and Touch controllers with PSoC and those panels are very neat and cheap to use it with cool projects!
Please feel free to use it, share it and improve it.
Don't hesitate to share your thoughts and feedback about it.
Next Improvement: To integrate SDCard for logging data and read Images to display!....
Show LessCQ出版 インターフェース 8月号に
CY8CKIT-044 を使用したADC のサンプル tester を投稿しました。
I contributed an ADC Sample Project "tester" to a Japanese
technical magazine "Interface" Aug. edition.
Interface2018年8月号 目次|Interface (p177)
記事では紙面の関係で動作時の写真やプロジェクトが省略されていますのでこちらに置いておきます。
Because of the page real estate the working "picture" nor "project" were not included in the article,
so I put them here 😉
moto
追伸:写真を見直してみて、測定電圧が正確ではないかもしれないことに気が付きました。
まぁ、サンプルということで・・・
P.S.: Seeing the picture again, I noticed that the displayed value may not be accurate.
But this is a "sample" anyway...
Show LessHi,
Although the "Mission" list suggests to upload binary, I could not figure out where to put one.
So I upload it here. If this is not an appropriate place, please let me know where to put it.
This is the first demo sample binary of mine, a simple maze project using CY8CKIT-044
and Adafruit 2.8" TFT Touch Shield.
https://www.adafruit.com/product/1651
It utilizes the KXTJ2 accelerometer on CY8CKIT-044 via I2C and
the 2.8" TFT via SPI.
The start point is upper-left and the goal is lower-right.
You can modify the maze by editing "maze.h."
moto
Show LessWhile looking for places to reduce code size, I noticed that the crc32_table takes up 1024 bytes in flash. I looked into the necessity of the table to consider a size/speed tradeoff, but I learned that the STM32 micros have a CRC32 hardware peripheral in them.
There's no reason that we shouldn't be able to use that, right?
I hope I am not missing something and duplicating work that already exists in the SDK:
In libraries/utilities/crc, I changed the implementation to:
// STM32 chips have an on-chip CRC32 generator
#ifdef USE_STM32_CRC32_PERIPH
#include "stm32f4xx_crc.h"
uint32_t WICED_CRC_FUNCTION_NAME( crc32 )
(
uint8_t* pdata, /* pointer to array of data to process */
unsigned int nbytes, /* number of input data bytes to process */
uint32_t crc /* either CRC32_INIT_VALUE or previous return value */
)
{
// reset CRC for INIT_VALUE
if(crc == CRC32_INIT_VALUE){
CRC_ResetDR();
}
//otherwise, we will have to assume that the previous result is still in the peripheral CRC buffer
return CRC_CalcBlockCRC((uint32_t*)pdata, nbytes/4);
}
#else
static const uint32_t crc32_table[256] = {
//...the rest of the existing implementation
#endif //USE_STM32_CRC32_PERIPH
And added USE_STM32_CRC32_PERIPH to GLOBAL_DEFINES at the platform level.
I also had to add a clock-enable command in the platform_init_external_devices() function ... is there a better place to put this?
/* CRC internal peripheral */
RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_CRC , ENABLE );
The obviously shortfall is when nbytes is not a multiple of 4, but in testing, that seems to not have come up yet.
Testing the two implementations, I don't seem to hit any errors in a debug build, and the DCT survives through a wiced_dct_write() and a reboot.
Using the cycle counter onCRC_INNER_LOOP for the 32bit case, it looks like it takes 38 cycles per byte, whereas the peripheral should take 4, and potentially save wait states when reading table entries from flash. (maybe the Cortex pipeline takes care of that, I don't know enough details about it)
And it appears that it runs ~250K-500K cycles quicker than the software implementation, or around 2-5 ms on my F4 platform.
And the 1K crc32_table no longer appears to be in the output image
Attached below is basic demo of polyphonic piano using PSoC5 (CY8KIT-059) as processing unit and MIDI Keyboard as input.
This is very basic demo to demonstrate interrupt-driven DDS technique with signal output to 8-bit VDAC. The project is heavily using CPU and interrupts (Arduino-style) and doesn't have any "advanced" features (DMA, etc), but it is good for introduction.
Attached are: project demo, project screenshots, related Cypress application note and YouTube video.
YouTube project demo video: Polyphonic piano demo using PSoC5 and MIDI Keyboard - YouTube
similar project:
Piano on Arduino (parts 1-4): Arduino MIDI synthesizer (Part 1) - Basic MIDI IN circuit - YouTube
MIDI Keyboard: MIDI Keyboard - Android Apps on Google Play
/odissey1
Hi All,
Attached is my Thermistor Calculator component ("myThermistor"). It calculates thermistor temperature from the resistance, similar to the Creator's stock Thermistor component. Calculated temperature returned as float-precision value with accuracy approx. 0.001 degC. Calculation speed is about 14-15x times faster than stock Thermistor component (formula-based) taking about 1100 CPU cycles.
The component was developed for fast TEC control, where accuracy, speed and wide temperature range were important. Attached archive contains the workspace bundle of the demo project, datasheet, screenshots and reference materials. Tested on PSoC5LP.
regards,
odissey1
P.S. Updated link to SRS Thermistor Calculator:
https://www.thinksrs.com/downloads/programs/therm%20calc/ntccalibrator/ntccalculator.html
Hi,
I am uploading a library of small off-chip components for annotation of the CY8CKIT-059 PSoC 5LP Prototyping Kit.
The KIT-059 component shows all on-board capacitors and pins with direct connections to the OpAmps, DACs, SARs, I2C, UART, LED and XTAL. It helps visualizing ports and pins and making connection diagrams for CY8CKIT-059 Prototyping Kit.
The accompanying library contains few small-sized off-chip annotation components (resistor, capacitors, OpAmps, DAC, etc.). The components are about 50% smaller than their stock analogs, allowing for tighter schematic placement.
The demo project shows all-analog PID control of the levitationg globe, implemented in CY8CKIT-059 PSoC 5LP Prototyping Kit, with annotation diagram created using KIT-059 component.
Attached archive contains component library, a demo project and enlarged picture of the Prototyping Kit. Last tested under Creator 3.3 CP3.
regards,
odissey1
//==============================================================================================
// ANNOUNCEMENT
//
//==============================================================================================
New version of the Annotation Library (v1.0) is available for download in the Community Code Examples section:
Please note that the Library structure has been re-worked entirely, so that old components (Resistor, Capacitor, etc. will not upgrade). The KIT-059 will update OK.
I recommend to use v1.0 of the Library for new projects, while keeping old projects as-is.
Message was edited by: odissey1 (Aug 01, 2019)
Show Less