Code Examples Forum Discussions
text.format{('custom.tabs.no.results')}
This is an example of the 8-bit PCM audio playback on PSoC4200M CY8CKIT-044 Pioneer Board using DMA.
Unlike the previous example, which used an interrupt to update the IDAC, this project is using DMA to transfer the data. This, however, comes with limitation on the audio data size to not exceed 65536 bytes.
The audio data are stored in the PSoC FLASH in 8-bit unsigned PCM format. The IDAC is configured as a Source. The IDAC current is converted into voltage using 3.3k load resistor buffered by the Opamp in the follower mode. For sound generation, the output is directly connected to the headphones with combined impedance of 64oHm (32+32).
The sound starts playing when the onboard switch button (SW2) is pressed, which triggers the DMA transfer. Once all of the data has been played, the sound stops. Subsequent button pressing during the playback restarts the sound wave.
The button events are captured using a ButtonSw32 custom debouncer component, utilizing a WDT0 timer for polling the pins state. The debouncer is set for the external interrupt, and pins state is processed using interrupt callback procedure, automatically clearing the interrupt source. The ButtonSw32 component is included into the project.
Attached project includes several test PCM audio files in 8-bit unsigned format:
sawtooth_8-bit_S.h - test sawtooth, 8-bit, Unsigned (size= 256 bytes)
smb_world_clear_5k5_N_U.h - Super Mario theme, 5.512kHz, Normalized, Unsigned (size=33600 bytes)
smb_world_clear_11kHz_N_U.h - Super Mario theme, 11.025kHz, Normalized, Unsigned (size=65536 bytes)
smb_world_clear_22kHz_U.h - Super Mario theme, 22.05kHz, Unsigned (size=65535 bytes, clipped)
The Super Mario theme produced about 5.5 sec playback with reasonable quality at both 5.5kHz and 11kHz update rate, and about 3 sec at 22.1kHz. No significant differences in audio quality between the samples has been observed. PSoC4 FLASH used was 28% for 5.5kHz files, and 54% for 11kHz and 22kHz files accordingly.
The WAV files have been converted to the C code using WAVtoCode v1.1.1 by Colin Seymour. The original WAV data have been Normalized to fill the entire 8-bit scale, which has increased the dynamic range.
Project attached contains all necessary files. It was tested using both Creator 4.0 and 4.4.
Credits:
WAVtoCode v1.1.1 by Colin Seymour: https://colinjs.com/software.htm#t_WAVToCode
Figure 1. Project schematic. The PCM data are fed from FLASH to the IDAC using chained DMA. The IDAC current is converted into voltage using 3.3k load resistor buffered by the Opamp in the follower mode, producing 0-1V signal at full scale.
Figure 2. DMA chain transfer mechanism. DMA1 is configured to transfer 1 byte of data on each clock from FLASH to the intermediate location in RAM, which is a LSB of the 2-byte CONTROL structure. DMA1 then triggers DMA2, which copies 2 bytes from the CONTROL structure to IDAC_1 control register. The structure of the IDAC_1 control register is shown below.
Figure 3. Custom debouncer component ButtonSw32, which captures SW2 button events and starts the playback.
Figure 4. Project annotation using the PSoC Annotation Library v1.0 and KIT-044. The Opamp output is directly loaded on the headphones with combined impedance of about 64oHm (32+32).
Figure 5. Screenshot of the test sawtooth playback at 5.5kHz. Using 3.3k load resistor, the 0-306uA IDAC range results in 0 to 1V output.
Figure 6. Screenshot of the sample audio playback at 5.5kHz.
Show Less
This is an example of the 8-bit PCM audio playback using PSoC4200M and CY8CKIT-044 Pioneer Board.
Audio data are stored in the PSoC FLASH in 8-bit signed PCM format, and sent to IDAC on the interrupt at 5.5kHz or 11kHz update rate. The project doesn't use DMA. The IDAC is configured in bidirectional mode (sink and source), corresponding to the sign of the data. The IDAC current is converted into voltage output using an Opamp operating in transimpedance mode. Opamp output is centered around voltage reference Vdd/2.
For sound generation, the output was directly connected to the headphones with combined impedance of 64oHm (32+32).
The sound starts playing when the onboard switch button (SW2) is pressed, which enables the update interrupt. Once all of the data has been played, the sound stops. Pressing the button again during playback restarts it from the beginning.
The button events are captured using a ButtonSw32 custom debouncer component, utilizing a WDT0 timer for polling the pins state. The debouncer is set for the external interrupt, and pins state is processed using interrupt callback procedure, automatically clearing the interrupt source. The ButtonSw32 component is included into the project.
The project includes several test audio files in 8-bit signed format:
sawtooth_8-bit_S.h - test sawtooth
smb_world_clear_5k5_N_S.h -Super Mario theme, 5.512kHz, Normalized, Signed (size=33512 bytes)
smb_world_clear_5k5_ND_S.h - Super Mario theme, 5.512kHz, Normalized and D-compressed (size=33608 bytes)
smb_world_clear_11kHz_N_S.h - Super Mario theme, 11.025kHz, Normalized (size=67064 bytes)
smb_world_clear_11kHz_ND_S.h - Super Mario theme, 11.025kHz, Normalized and D-compressed (size=67064 bytes)
The Super Mario theme produced about 5.5 sec playback with reasonable quality at both 5.5kHz and 11kHz update rate. PSoC4 FLASH used was 28% for 5.5kHz files, and 54% for 11kHz files accordingly.
The WAV files have been converted to the C/H code using WAVtoCode v1.1.1 by Colin Seymour.
The original WAV data have been Normalized to fill the entire 8-bit scale, which increased the dynamic range. For testing purposes some files were additionally D-compressed (log-trimmed) using the BTc SoundEncoder v3.0 by Roman Black, which can further increase the fullness of the sound.
Project attached contains all necessary files. It was tested using both Creator 4.0 and 4.4.
Credits:
WAVtoCode v1.1.1 by Colin Seymour: https://colinjs.com/software.htm#t_WAVToCode
BTc SoundEncoder v3.0 by Roman Black: http://www.talkbotbrain.com/
Figure 1. Project schematic. The PCM data are fed from FLASH to the IDAC on isrTimer interrupt. The IDAC operates in both sink and source modes, updating the mode according to the data sign. The Opamp operates in transimpedance mode with feedback resistor 3.3k, producing +/-1V peak amplitude at full scale around the the reference Vdd/2.
Figure 2. Custom debouncer component ButtonSw32, which captures SW2 button events and starts the playback.
Figure 3. Project annotation using the PSoC Annotation Library v1.0 and KIT-044. The reference voltage Vdd/2 was pulled from the onboard hidden Pin_5[0], reserved for the light sensor. Capacitors C1 and C2 are optional.
Figure 4. Screenshot of the sample audio playback at 5.5kHz.
Figure 5. Screenshot of the test sawtooth playback at 5.5kHz.
Show Less
Hi,
I am looking for the CY3635 Wireless USB N:1 DVK hub/sensor firmware. I can only find the host software/docs below. I need the PSoC firmware i.e. the .c and .h files.
Show Less
Hi,
Here is my code sample of measuring a pin capacitance using the CapSense component.
I used CY8CKIT-044 but I hope that porting this to ather PSoC 4 which is supporting CapSense won't be difficult.
The key function is "CapSense_GetSensorCapacitance()" which is available only when "Enable self-test library" is checked.
I've used this function a few times before, but as usual I mislocated my code(s).
So this time I decide that to post this sample here will be useful (at least for me).
Schematic
CapSense configuration
[ Basic Tab]
CSD tuning mode : SmartSense (Hardware parameters only)
"SmartSense (Full Auto-Tune)" is not supported for the "self-test library"
[ Advanced Tab]
"Enable self-test library" is checked.
Pins
Note: I used P3[4] which is a built in electrode of CY8CKIT-044
but any pin supported by the CapSense component should work.
Tera Term log
main.c
#include "project.h"
#include "stdio.h"
#define TEXT_LEN 64
char str[TEXT_LEN+1] ;
#define print(s) UART_UartPutString(s)
void cls(void)
{
print("\x1b[2J") ;
CyDelay(100) ;
print("\x1b[;H") ;
CyDelay(100) ;
}
void splash(char *title)
{
cls() ;
snprintf(str, TEXT_LEN, "%s (%s %s)\n\r",title, __DATE__, __TIME__) ;
print(str) ;
}
volatile int sw2_pushed = 0 ;
CY_ISR(sw2_isr)
{
SW2_ClearInterrupt() ;
sw2_pushed = 1 ;
}
void init_hardware(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start() ;
SW2_ClearInterrupt() ;
sw2_int_ClearPending() ;
sw2_int_StartEx(sw2_isr) ;
CapSense_Start() ;
}
void print_measure_error(uint32_t status)
{
switch(status) {
case CapSense_TST_MEASUREMENT_SUCCESS: print("SUCCESS") ; break ;
case CapSense_TST_MEASUREMENT_BAD_PARAM: print("BAD PARAM") ; break ;
case CapSense_TST_MEASUREMENT_LOW_LIMIT: print("LOW LIMIT") ; break ;
case CapSense_TST_MEASUREMENT_HIGH_LIMIT: print("HIGH LIMIT") ; break ;
case CapSense_TST_MEASUREMENT_ERROR: print("Measurement Error") ; break ;
default:
snprintf(str, TEXT_LEN, "Unknown Error: 0x%08X", status) ;
print(str) ;
break ;
}
print("\n\r") ;
}
uint32_t button_cap = 0u ;
void measure_cap(void)
{
CapSense_TST_MEASUREMENT_STATUS_ENUM measurementStatus ;
while(CapSense_NOT_BUSY != CapSense_IsBusy()) {
/* wait for capsence to be free */
}
button_cap = CapSense_GetSensorCapacitance(
CapSense_BUTTON0_WDGT_ID,
CapSense_BUTTON0_SNS0_ID,
&measurementStatus) ;
if (measurementStatus == CapSense_TST_MEASUREMENT_SUCCESS) {
snprintf(str, TEXT_LEN, "capacitance: %d.%03d pF\n\r",
button_cap/1000, button_cap % 1000) ;
print(str) ;
} else {
print_measure_error(measurementStatus) ;
}
}
int main(void)
{
init_hardware() ;
splash("Pin Capacitance Measure Test") ;
print("Push SW2 to measure\n\r") ;
for(;;)
{
if (sw2_pushed) {
sw2_pushed = 0 ;
measure_cap() ;
}
}
}
Some more background
There was a discussion about measuring a pin capacitance.
https://community.infineon.com/t5/PSoC-4/Analog-Digital-pin-control/m-p/455832#M45427
After I posted my sample, I noticed that there was a typo in the comment.
/* wait for capsent to be free */
So I wanted to fix it, then I noticed another minor problem which is in case the measurement encounters an error,
the printed error message does not have a new line, so next message will be printed just after that error message.
After all, although basic function has not been changed, some more touch ups were applied from my previous post.
(1) Typo in a comment
(2) New line added after error report
(3) Clear pending pin interrupts before starting the ISR
(4) Some code clean ups
(5) The value was in fF, now shown in pF
(6) Schematic rearranged (no functional changes)
moto
Show Less
So in a couple of days, there will be an event named "Infineon MCU Partner & Solution Day 2023" in Japan.
"Infineon MCU Partner & Solution Day 2023" が明後日と迫って来ました。
https://www.infineon.com/cms/jp/product/promopages/event/infineon-mcu-partner-solution-day-2023/
This time, I tried to create a demo using a TSoC board (CY8C4146LQI-S433) and the Elephantec's new demo board which mounts a sensor and a companion resistor on their P-Flex.
今回は先にも紹介させていただいた
「PSoC基板で始める回路図プログラミング」に付属のTSoC (CY8C4146LQI-S433) 基板と、https://interface.cqpub.co.jp/psocbook/
P-Flex 基板上に直接センサと抵抗を搭載した
エレファンテック社のデモボードを使用したデモを作ってみました。
https://info.elephantech.co.jp/p-flex
Since the demo will be put on our booth, it should work without a PC (and its operator)
I reused my previous sample of driving a cheap OLED display, which I purchased 3 of them from Amazon 😉
ブースの置いたデモに常に PC (とその操作員) を置いておかなくても良いように
以前作成した I2C 接続の OLED ディスプレイを再度使用しました。(アマゾンで3個セット買っちゃてたし)
So the schematics are
ということで、回路図は
(1) TSoC, KitProg, and OLED
(2) ADC, Thermistor and ELD demo board
Note: This might be the first time I used "Differential" input ADC...
The "Thermistor" component is nice!
※ ADC で差動入力を使ったのはこれが初めてかも知れません。
「Thermistor」コンポーネント、便利だ!
BTW, at the beginning, I forgot to connect V_H to VDD and V_L to GND,
and the temperature was about -154 C deg, a little too cold even in the summer. (lol)
ところで、当初 V_H と VDD, V_L と GND を接続するのを忘れていたところ
気温が -154℃と、真夏でも涼しすぎるだろうという値になっていて悩みました。w
(3) Connection instruction (in case the demo will be accidentally disassembled)
何かの拍子にデモがバラバラになってしまった時用の接続図
Pins
main.c
#include "project.h"
#include "stdio.h"
#include "i2c_utils.h"
#include "tty_utils.h"
#include "ssd1306.h"
#include "ssd1306_utils.h"
#include "func_list.h"
#define SENSOR_INTERVAL 3000
#define MODE_IDLE 0
#define MODE_RUN 1
volatile int sensor_flag = 0 ;
int mode = MODE_RUN; // MODE_IDLE ;
char *sensor_type = "P-Flex 3u SENSOR" ; // Ref Resistor = 220Kohm
void do_help(void) ;
void do_read_status(void) ;
void do_com_pin(void) ;
void do_com_direction(void) ;
void do_segment_remap(void) ;
void do_set_contrast(void) ;
void do_set_page(void) ;
void do_set_column(void) ;
void do_text_locate(void) ;
void do_entire_display_on(void) ;
void do_inverse_display(void) ;
void do_set_display_on(void) ;
void do_test_pattern(void) ;
void do_draw_str(void) ;
void do_clear_display(void) ;
void do_run(void) ;
void do_stop(void) ;
void display_init_oled(void) ;
#if 0
f_list_type main_func_list[] = {
{ "help", do_help, "show help message" },
{ "com", do_com_pin, "Set COM Pins Hardware Configuration (0-3)"},
{ "direction", do_com_direction, "Set COM output Scan direction, (0-1)"},
{ "remap", do_segment_remap, "Set Segment Re-map"},
{ "contrast", do_set_contrast, "Set Contrast Control {0 - 255}"},
{ "status", do_read_status, "read status register" },
{ "EntireDisplayOn", do_entire_display_on, "Entire Dsiplay ON { 0 | 1 }"},
{ "inverse", do_inverse_display, "Set Normal/Inverse Display { 0 | 1 }"},
{ "display", do_set_display_on, "Set Display ON { 0 | 1 }"},
{ "clear", do_clear_display, "Clear Display"},
{ "TestPattern", do_test_pattern, "Display Test Pattern"},
{ "locate", do_text_locate, "Specify text location x, y"},
{ "page", do_set_page, "Set Page"},
{ "col", do_set_column, "Set Column"},
{ "print", do_draw_str, "Draw a string"},
{ "run", do_run, "Start measurement"},
{ "stop", do_stop, "Stop measurement"},
{ 0, 0, 0}
} ;
#endif
f_list_type main_func_list[] = {
{ "run", do_run, "Start measurement"},
{ "stop", do_stop, "Stop measurement"},
{ "help", do_help, "show help message" },
{ "contrast", do_set_contrast, "Set Contrast Control {0 - 255}"},
{ "status", do_read_status, "read status register" },
{ "EntireDisplayOn", do_entire_display_on, "Entire Dsiplay ON { 0 | 1 }"},
{ "inverse", do_inverse_display, "Set Normal/Inverse Display { 0 | 1 }"},
{ "display", do_set_display_on, "Set Display ON { 0 | 1 }"},
{ "clear", do_clear_display, "Clear Display"},
{ "TestPattern", do_test_pattern, "Display Test Pattern"},
{ "locate", do_text_locate, "Specify text location x, y"},
{ "page", do_set_page, "Set Page"},
{ "col", do_set_column, "Set Column"},
{ "print", do_draw_str, "Draw a string"},
{ 0, 0, 0}
} ;
void do_help(void)
{
show_help(main_func_list) ;
}
void do_run(void)
{
display_init_oled() ;
mode = MODE_RUN ;
}
void do_stop(void)
{
mode = MODE_IDLE ;
}
// SysTick Related functions
volatile uint32_t tick_count = 0 ;
CY_ISR(tick_callback)
{
tick_count++ ;
if (tick_count >= SENSOR_INTERVAL) {
tick_count = 0 ;
sensor_flag = 1 ;
}
}
int find_empty_slot(void)
{
int result = -1 ;
uint32_t i ;
for (i = 0 ; i < CY_SYS_SYST_NUM_OF_CALLBACKS ; i++ ) {
if (CySysTickGetCallback(i) == NULL) {
result = i ;
break ;
}
}
return(result) ;
}
void init_systick(void)
{
int sys_tick_slot ;
sys_tick_slot = find_empty_slot() ;
if (sys_tick_slot < 0) {
print("Sorry No empty SysTick Slot available\n\r") ;
while(1) { } /* halting here */
} else {
CySysTickStart() ;
CySysTickSetCallback(sys_tick_slot, tick_callback) ;
}
}
// Thermo Sensor related
int16_t get_temp(void)
{
int16_t cReference, cThermistor ;
int16_t vReference, vThermistor ;
uint32_t resultT ;
int16_t temp ;
ADC_StartConvert() ;
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT) ;
cReference = ADC_GetResult16(0) ;
cThermistor = ADC_GetResult16(1) ;
vReference = ADC_CountsTo_mVolts(0, cReference) ;
vThermistor = ADC_CountsTo_mVolts(1, cThermistor) ;
resultT = Thermistor_GetResistance(vReference, vThermistor) ;
temp = Thermistor_GetTemperature(resultT) ;
return( temp ) ;
}
void init_hardware(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
init_systick() ;
tty_init() ;
I2C_Start() ;
ADC_Start() ;
}
void display_init_oled(void)
{
clear_display() ;
text_locate(35, 1) ;
draw_str("Elephantech") ;
text_locate(25, 3) ;
draw_str(sensor_type) ;
}
int main(void)
{
func_ptr func ;
int16_t temp ;
int prev_mode = MODE_IDLE ;
init_hardware() ;
splash(sensor_type) ;
ssd1306_init() ;
do_help() ;
prompt("> ") ;
display_init_oled() ;
for(;;)
{
if (get_line()) {
func = get_func(main_func_list, str) ;
if (func) {
func() ;
} else {
print("Unknown Command: ") ;
println(str) ;
do_help() ;
}
prompt("> ") ;
}
if (sensor_flag) {
sensor_flag = 0 ;
if (mode == MODE_RUN) {
if (mode != prev_mode) {
prev_mode = mode ;
display_init_oled() ;
}
temp = get_temp() ;
if (temp >= 0) {
snprintf(str, 32, " %3d.%02d ", temp/100, temp%100) ;
} else {
snprintf(str, 32, "-%3d.%02d ", -(temp/100), -(temp%100)) ;
}
print(str) ;
print("\r\n") ;
// text_locate(40, 6) ;
// draw_str(" ") ;
text_locate(40, 6) ;
draw_str(str) ;
}
}
}
}
Attached are project for the three different type baords
また、3種類用意されたセンサ基板用に3つのプロジェクトも添付しておきます。
3um board: elt_oled_test_230623A
12um board: elt_oled_test_230623B
FR4 borad: elt_oled_test_230623C
moto
P.S. I'm looking forward to seeing you at the event 😉
追伸:それでは会場でお会いできることを楽しみにしております。m(_ _)m
Show Less
This example demonstrates RTOS use case with semaphores to trigger tasks using FreeRTOS on two cores separately.
- LEDs will blink in sequence based on the way semaphores are activated.
- Three tasks are configured and used with for each CM7 core.
Test environment:
- CYTVII-B-H-8M-320-CPU Rev. C Board
- CYTVII-B-E-BB Rev.A Board
- IAR version 8.42
- SDL version 7.7.0
Description Overview
Attached project outputs the following signals
1. PWM signal (2) that rises with a fixed time delay(3) relative to the rising and falling edge of the PWM signal (1)
2. (1) Period = (2) Period × 2
3. Update the High width of (1) and (3) during operation
Required Environment
• Evaluation board: KIT_A2G_TC364_5V_TRB_S (Starter Kit containing TC364 Triboard, using LQFP version )
• IDE name: ADS 1.5.4
• Oscilloscope
• ADS project attached below
procedure
1. Connect oscilloscope probes to P13.2 and P13.0.
2. When the project attached to this topic is operated, the waveform shown in the image below can be observed, in which the High width and DELAY of the second PWM (2) change periodically.
Software Protection Units (SWPU) is one of the four protection units implemented in TRAVEOTM T2G devices. It is further classified into:
- Flash Write Protection Units (FWPU)
- eFuse Write Protection Units (EWPU)
- eFuse Read Protection Units (ERPU)
This code example explains the usage of FWPU for creating Hardware Security Module (HSM) exclusive flash region (For more information refer - AN219843 Protection configuration in TRAVEO™ T2G MCU . For further information on SWPU, refer Section 6.5 in TRAVEOTM T2G Technical Reference Manual).
HSM flash region refers to the memory region which contains the HSM core’s firmware and the application. In TRAVEOTM T2G, HSM core refers to the ARM® Cortex® M0+ CPU and HSM client refers to the ARM® Cortex® M4 or M7 CPU. It is thus essential to ensure only the HSM core or the appropriate bus masters of the microcontroller can access to this region.
In this example, the HSM core configures an FWPU region in supervisory flash (SFLASH) with the appropriate access attributes. This provides write protection for the HSM flash region. The HSM client tries to erase this region using the system call “erase sector”. This request fails because the HSM client has different access attributes than the configured FWPU. We will see the return status code of the system call.
The code was developed in IAR Embedded Workbench for ARM® (EWARM) with Sample Driver Library (SDL). The code example uses TRAVEOTM II Body Entry kit board. The IAR linker scripts in SDL has predefined section named “sflash_app_prot” which spans over the SFLASH region (0x1700_7600 – 0x1700_77FF). This is where the SWPU object is placed.
The following points describe the working of the attached program files.
“main_cm0plus.c”:
- Initialization of necessary macros and access attributes.
- Configuration of the structure “cy_stc_si_app_prot_t” for defining FWPU with necessary access attributes. Placing the same in section “sflash_app_prot” in SFLASH.
- Configuration of access attributes of HSM client and setting active Protection Context (PC) of HSM client as PC3.
- Enabling the HSM client.
“main_cm4.c”:
- Initialization of necessary macros and objects for invoking a system call.
- Invoking the system call “erase sector” in blocking mode over the FWPU protected region.
- Updating the return value variable “apiStatus” with the response status code of the system call.
The “cy_si_config.h” file contains the necessary structure definitions for the structure “cy_stc_si_app_prot_t”. The return value “apiStatus” gets updated with a value “f000’0005” as shown in Figure 1. This means “FLASH or eFuse bytes are read/write protected via protection units” (Refer Section 37.5 of TRAVEOTM T2G Technical Reference Manual).
Figure 1: apiStatus return value
Thus, by configuring an FWPU object with the appropriate access attributes, we have shown that the execution of the system call “erase sector” is blocked and the corresponding return status code of the system call is updated.
NOTE :
- The register “PROT_SMPU_MS14_CTL” that is responsible for configuring the access attributes of the HSM client can be further protected by configuring the appropriate fixed Peripheral Protection Unit (PPU) that protects the access to this register. This ensures that once this fixed PPU is set, the HSM client won’t have access to this register anymore and thus can’t revert the register back to its default value.
- If any system calls are requested over an FWPU protected region, it is the requestor’s access attributes that are evaluated against FWPU access attributes.
- Configuring a Shared Memory Protection Unit (SMPU) over the HSM flash region gives flash read protection only and not flash write protection. Configuring an FWPU is the only way to provide flash write protection.
Hi,
Here is my version of the quadrature decoder with a button switch custom component (QudDec_SW), which was designed for interfacing of rotary shaft encoders to PSoC4 and PSoC5. It has been created out of necessity to save hardware resources in projects with limited or exhausted UDB/PLD space. The stock PSoC5 QuadDec component with hardware debouncer are consuming three Datapath cells per single encoder, which is too much for a device which remains idle for most of the time.
The QuadDec_SW component is implemented entirely in software, without using any UDB resources. It is sufficient for hand-operated rotary shaft encoders for non-critical operations such as scrolling menu or updating parameters.
The QuadDec_SW component has several options
Returns position and direction of rotation.
Optional 8-bit, 16-bit, 32-bit, single or double position range.
Optional button switch with debouncing.
Optional increment step size.
Optional range limits.
Uses interrupt or polling technique.
Attached archive contains component library, several demo projects for PSoC5 and PSoC4, a component datasheet, Application Note and algorithm description paper. Please read installation instructions in the readme.txt. Since the Community Components forum is no longer exists, it is being posted here, PSoC5 forum, as the most relevant place to be.
The component provided as-is, no liabilities. It is free to use and modify.
regards,
odissey1
YouTube demo: using QuadDec_SW with DDS24 signal generator
DDS tunable frequency / phase generator using Cypress PSoC5 - YouTube
YouTube demo: using QuadDec_SW for PLL tune-up
Custom Phase Lock Loop (PLL) demo using PSoC5 microcontroller. PSoC 5lp - YouTube
=============================================================================
P.S. In case if only buttons events (w/debouncing) are needed, another simple component is available (ButtonSw32)
ButtonSw32: button switch debouncer component
Message was edited by: odissey1 Scroll down for v0.2 of the component, which is compatible with Creator 4.4.
Show LessDears,
underneath the description of the CYCKIT-059 based robots built and programmed by Manetti high school students
to join RoboCup jr. Soccer competitions.
Robots play 2 vs 2 soccer like matches.
The Manetti team won the Italian championship that was held in Rome on May 2023.
Hence it will represent Italy in World Championship in Bordeaux( 4-9 July 2023).
The Core of the robots is the CY8CKIT-59 programmed with the FreeRTOS port to PSoC5LP.
The whole Workspace is in the attached FreeRTOSv202111.00.zip file.
A presentation of the project is in the attached RoboCup jr. Soccer Open ENGLISH VERSION.pdf file.
The main PSoC features used in our project are:
- DMA to detect playground edges( whitelines) at the fastest possible rate of 1Ksample/sec:
- FreeRTOS: in BlockQdat1.c file are defined the producer tasks used to acquire sensors output( openMV camera, line sensors, BNO055 IMU, ball capture sensors ) and the consumer task that controls motors, "dribbler" and "kicker"
- Extensive use of PSoC internal analog and digital circuits to minimize code:
This is a video showing our robots playing during tests
Here is the Indiegog Page to fund the Team journey to Bordeaux
Show Less