Quantcast
Channel: Cypress Semiconductor - PSoC 5 Device Programming
Viewing all 387 articles
Browse latest View live

Writing 16bit to value to pins

$
0
0

Hi, 

I'm looking into coding device which uses 16 pins to transfer 16bit data using PsoC 5LP . As I start with PsoC I'm looking for some tips where to find more information about how to go about it. 

Till now what I have seen is I could use control register or group 8 pins but that would allow me to write 8bit value only.

But when I group 16 pins I dont have access to i.e. writing directly 16bits. 

I have taken a look at several documents and some of the components and If I'm correct here I would need to write to appropriate port registers functions to write 16bit value ? and most likely use CY_SET_REG16 to write my desired value ? 

 

Thanks in advance for any help here

Regards

Rafal

 


Programming cypress CY8C5566AXI-061

$
0
0

I am trying to program PSoC5 CY8C5566AXI-061 on a custom made PCB using 5pin connector, with miniprog3 (active protocol: SWD). The CY8C5566AXI-061 is detected correctly in PSoC Creator. In PSoC programmer it's detected as CY8C5586AXI-061.

The board is powered from external source.

Anyways, when I try to program it from PSoC Creator i get the error (same happens from PSoC Programmer):

Error: dbg.M0023: There was an error while programming the device: PSoC Programmer reported error (100 - FAILED! SWD respond packet contains Failed status!)

(I tried to lower the clock speed but nothing changed)

The settings from PSoC Creator are:

Active Protocol: SWD

Clock speed: 1.6MHz

Power: External

Acquire mode:

Reset Connector: 5pin

The settings from PSoC Programmer are:

Programmer: MiniProg3

Programming mode: Reset

Auto detection: OFF

Protocol: SWD

Voltage: 5V Connector: 5p

Clock Speed: 1.5MHz

Device: CY8C5566AXI-061

The pin connectios from MiniProg3 to PSOC5 (on the custom made PCB) are:

VTARG - VDDDIO1

GND - GND

XRES - XRES (on pin 15)

SCLK - P1[1] (on pin 21)

SDAT - P1[0] (on pin 20)

VDDIO0, VDDIO1, VDDIO2, VDDIO3, VTARG, VDDD, VDDA are all conected together to 5V.
VSSD, VSSA are connected together to ground.
The two VCCD pins are connected together with 1uF capacitor.
VCCA is connected with 1uF capacitor to ground.

I made the PCB again (now the external supply is 3.3V) and I get the same error. I am struggling with this issue since about 1 week 

 

Verilog on PSoC 5lp

$
0
0

so, I have a schematic design that I want to turn to verilog, and interface the verilog to the microcontroller.  right now, the MCU is not involved, it's just a simple sequential logic design.  I found the verilog file that gets created upon "build" and pasted it into a newly created source in the design.  however, I don't think the design is working now.   I also want to expand it to communicate with the microcontroller, and I have no idea how to do that. 

 

does anyone have a simple example of this?

SPI Clock and Data Phase Setting

$
0
0

We are putting together a simple SPI based controller to talk to LPD8806 LED driver ICs for addressing multiple LEDs in a large array using a PSoC 5 (overkill at the moment but that's what we have lying around!).

The driver ICs use a simple, one directional (no feedback) serial data protocol with Clock and data lines (data sheet attached) so we are using an SPI-Master component to drive it.  Looking at the "Mode" settings the driver ICs need to read the data on the rising edge of the clock 90 degrees out of phase with the data - this equates to the CPHA = 0, CPOL = 0 settings for the SPI_Master.  However, looking at the scope on the data and clock lines they are in phase with these settings.  In fact I have tried all four possible combinations of CPHA/CPOL and they are always in phase - scope screen shot attached.

I am obviously doing something wrong but can't work out what it is.  Any ideas?

By the way, these are great LED driver ICs, very cheap and flexible. 

Many thanks

PS - The application is actually functioning as it is but I'm concerned that it is probably running "on the edge" and want to get it right to ensure it is robust.  In case you're interested, the attached photo shows the proof-of-principal panel of 144 leds - production units will have over 2500 addressable LEDs.

Programming CY8C5888LTI-LP097

$
0
0

I am attempting to program a CY8C5888LTI-LP097 on a custom board using the MiniProg3 (gerber files attached) but the IC is not found when I attempt to program. I have double checked all my connections and verified that I am getting power where there needs to be (all VDDIO tied to VDD, and VCCD reads 1.78V). Is there something I am missing?

 

Thanks in advance,

Adam

SPI_Design01 Example hangs on while loop

$
0
0

I am using a CY8CKIT-050 PSoC5 with PSoC Creator 4.0 Update 1. I downloaded the example design SPI_Design01. In Device Selector I changed the device from CY8C38 series (PSoC3) to my CY8C5868AXI-LP035 chip.
No output displayed on the LCD.

For diagnosis, I added the board's two LEDs to the design. In main.c I turn one LED on just before the while loop and the other LED just after the while loop. The first LED lights but the second does not. This shows that the hang is in the while loop. I temporarily changed the & in the while loop to && and displayed garbage output, of course. With && ANY bit in the Status could satisfy the condition. This shows that SPIS_STS_SPI_DONE bit is never set.
I set a breakpoint at the while loop and stepped through. The last code executed was in SPIS.c lines 416 to 433. Control returned to the while loop.
I have jumper wires connecting:
m_miso to s_miso ( P0[2] to P0[3] )
m_mosi to s_mosi ( P0[0] to P0[1] )
m_sclk to s_sclk ( P0[4] to P0[5] )
m_ss to s_ss  ( P0[6] to P0[7] )

Does anyone have suggestions or time to try my build? I have attached the Archive complete file.

PCB design for CY8C5287AXI-LP095

$
0
0

Hi, 

I have started PCB design for my custom board for learning PsoC. Since I have not found more appropriate forum division to place my questions please move if necessary to different one. 

Based on cypress documentation / processor AN and several other sources I have managed to find I have come with initial design which I attached in this post. This is still work in progress but I'm looking forward for your input.

My design goals included 

  • Have multiple voltage domains ( 1.8V /3V3 and 5V )
  • Have digital and analog split 
  • Be able to choose which voltage is applied to which digital port 
  • Support USB 

My questions are to the more experienced ones :)

  1. If I have routed the proper connections for powering of the device ?
  2. If I would power VDDIO_1 with 3V3 then I cannot program it with 5V / 
  3. In my plan VDDd will be +5V would that be correct ? 
  4. VDDa will be +5V so here I presume I have made correct choice considering it needs to be equal or greater than other VDDx 

 

Thanks a lot for everyone input! 

 

Regards

Rafal

 

 

WaveDAC changes from software

$
0
0

Hi,

 I'm still new to the PSOC family, so please forgive what may be a potentially daft question. With the WaveDAC I know it's possible to set a frequency and leave it running (yay), but is it possible to change this frequency in software?

 For example, read an ADC, do some munging in C, then change the frequency of the WaveDAC output. Is that possible?

Paula


Delta Sigma ADC

$
0
0

I’m working on PSoC 5 kit. I want to sample my signal at a frequency of 360Hz with a resolution of 12bits. If I’m using delta-sigma ADC with a resolution of 12bits I can acquire a minimum of 4000 samples per second. Is there any alternative to reduce the number of samples?

Best way to interface PSoC with an FPGA

$
0
0

Dear All,

What would be the best possible way to interface PSoC5-LP with an FPGA kit?. Long story short, I want to feed FPGA with the ADC values coming from PSoC5-LP. An example program would be solemnly appreciated. 

Bundles of thanks in advance!

5LP as I2C Slave

$
0
0

I was reading some of the examples and thought I could make some quick progress by running a quick test but I seemed to have failed at step one.

 

I added an EZI2C Slave module to my project and then copied the following code into my main.c:

 

/* Slave address of the EZI2C */
#define EZI2C_SLAVE_ADDR        (0x08u)
#define BUFFER_SIZE             (0x04u)
#define BUFFER_RW_AREA_SIZE     (0x02u)

/* Denotes the offset inside the EZI2C buffer */
#define SLAVE_ADDR_SIZE         (0x01u)

/* EZI2C buffer */
uint8   ezi2cBuffer[BUFFER_SIZE];

/* I2C buffer with the data read from EZI2C */
uint8   i2cBufferRead[BUFFER_SIZE];

/* I2C buffer with the data to be written to EZI2C */
uint8   i2cBufferWrite[SLAVE_ADDR_SIZE + BUFFER_SIZE];

int main()
{

...

/* Start EZI2C */
    EZI2C_Start();
    
    /* Enable global interrupts */
    CyGlobalIntEnable;
    
    /* Initialize EZI2C buffer's read only data */
    ezi2cBuffer[BUFFER_RW_AREA_SIZE     ] = 0xAAu;
    ezi2cBuffer[BUFFER_RW_AREA_SIZE + 1u] = 0xBBu;

    EZI2C_SetBuffer1(BUFFER_SIZE, BUFFER_RW_AREA_SIZE, (void *) ezi2cBuffer);

 

I thought this would be enough to see the 5LP on the I2C bus and even read the initial data but the 5LP doesn't show up on the bus. I have 2 other devices on the board that do show up and I can read from them so the I2C bus seems to be working.

Is there something that I'm missing here?

 

Thanks,

George 

5LP PID Control

$
0
0

Hi guys, I'm just looking for advice on implementing multiple PID controllers on one psoc. This is for a mechanical engineering capstone project, so none of us have a lot of experience with C programming. Luckily we have a friend who's worked with psoc's a lot but I wanted to get more input from this community. The project is basically a mini SpaceX Facon 9 rocket with 9 total propellers to control pitch and yaw using an IMU sensor. We have a Psoc 5LP and we were hoping to use this for the PID controllers and Kalman filters, and we already have code setting up duty cycles and pin connections and whatever, but I just wanted to know if there are any good guides on PID control with Psoc? We got a good Creator workspace from our friend that was used to fly a drone, but I've been having a hard time deciphering the code since I'm pretty new to Psoc and C programming. Sorry for the wall of text, and thanks for any help!

Array declaration

$
0
0

Hi,

I would like to ask for advice on declaring and using arrays. Attached is my code.

It is controller for 8x8x8 RGB LED Cube. Levels(anodes) are driven by mosfets, mosfets driven by additional NPN transistors, connected to Levels port. Cathodes are driven by shift register TPIC6C595, connected to SPIM_1, with storage register clock generated manually(because I need it fire after all 24 bytes are transferred).

I have a question about lines 15 to 20 and 44 to 61. Do I use volatile correctly? Do I need it? Is my declaration of "array aliases" at line 44 correct?

For now there is no code to store values to arrays containing patterns to display on cube. But I plan to program PSoC5 as a USB device, so patterns can be generated on PC, and I won't have to reflash PSoC each time I want to change patterns.

 

Stanislav Husár

Attachments: 

Connecting a bus with an index offset in schematic

$
0
0

hello,

 

I have a control register (8 bit wide bus) in my schematic, and I want to take that bus and run it to two places.  the first destination is just a straight connection bit for bit.  for the other destination, I want to send the control register's upper 7 bits to the destinations lower 7 bits (a right shift, effectively) and concatenate a different wire onto the upper input.  

 

something like:
 

assign destination_reg[7:0] =  {single_bit , control_reg[7:1]}

 

such that if single_bit is 1, and control_reg was 00110101, that destination_reg[7:0] would be 10011010

 

what is the best way to do this in the schematic editor?  I don't know how to manipulate the buses well enough.  I could make 7 series-pairs of not gates (effectively a buffer), and assign the inputs to the upper bits of the control_reg bus, then assign the outputs to the lower bits of the destination_reg, but that's really messy.

CY8CKIT-059 / Kitprog / 3.3V Operation Questions

$
0
0

Although I've seen a few variations of this questions, I would like to verify some additional points prior to modifying the prototyping board. Section 4.2.3 details the options around powering the device. 

When powering from an external regulated supply connected to VDD: 

"KitProg measures the target voltage and adjusts the logic levels on the programming pins accordingly."

Three questions from this: 

1) Which pin does the KitProg sample to measure the target voltage?

2) For the UART_TX, UART_RX, I2C_SDA, and I2C_SCL signals that are connected between the target and KitProg, do those logic levels also become adjusted based on the target voltage? Or, would they need to be broken apart and run through level shifters. 

I would like to continue using the USB-UART functionality even when the target is 3.3V powered. 

3) I am unable to tell for certain if a 3.3V powered target will still have 5V tolerant pins. 

Thanks, 
Karl 


Hex file upload problem with programmer

$
0
0

I get this error when trying to upload a hex file to my board                                                                     

FAILED! Hex File parsing failure. PSoC Programmer does not support current type of hex file

At the moment not sure which hex file I need to upload. How do I tell which is the one I need to upload with the PsOC Programmer?

 

Generating a 16 Mhz clock on a GPIO pin

$
0
0

Hi,

Can I generate a 16 MHz clock on an output GPIO pin on cy8ckit-059 kit?

I am able to generate 24 MHz and integer divided clocks of 24 MHz (for example 12 MHz), but not 16 MHz. Giving a frequency value of 16 MHz still generates a 12 MHz clock.

Regards,

Vishnu

Setting for maximum 1MSPS speed for SAR ADC in CY8CKIT-059LP

$
0
0

Dear all

 

How to program the SAR ADC with full speed of 1 MSPS. I am using  CY8CKIT-059 kit. I am getting the error while configuration with 1MSPS of 18MHz colck.  Please help.

Play audio sample from external and internal memory

$
0
0

I was wondering how does one play samples? The first thing I'd like to achieve is to play a sine wave from a waveform sample. I wonder if I can do that or is there a simpler way?

Store raw audio in EEPROM -> drive DMA with clock or PWM -> pipe DMA output to DAC 

If there are any examples or application notes on this, I'd really appreciate that! Also, can I play audio from external memory (as in SD card)?

 

 

 

 

Blink code in C

$
0
0

I wanted to re-create the blink example using the Cortex core only, no digital or analog modules. So far this is what I got but I still can't see the LED (port 2 pin2) blinking. What am I missing?

 

#include <project.h>
#include <cypins.h>
#include <cydevice_trm.h>

#define CYREG_PRT2_PC1 0x40005011u         //define pin 2.2
#define CyPins_SetPin(pinPC)     ( *(reg8 *)(pinPC) |= CY_PINS_PC_DATAOUT)     //set pin
#define CyPins_ClearPin(pinPC)   ( *(reg8 *)(pinPC) &= ((uint8)(~CY_PINS_PC_DATAOUT)))    //clear pin

int main()
{
  
    while(0)
    {
        CyPins_SetPin(CYREG_PRT2_PC1);
        CyDelay(1000);
        CyPins_ClearPin(CYREG_PRT2_PC1);
        CyDelay(1000);        
    }
    return(1);
}

Viewing all 387 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>