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

maths lib bootloader issue

$
0
0

Hi,

I'm having a problem getting the bootloader working when compiling under Creator 4.0.

The code has maths functions in and compiles with no bootloader.

As soon as I add the bootloadable errors are throw for each math function in the code.

 

I've tried adding m to the additional includes in the bootloader project to no avail.


8 bit to 16 bit conversion using DMA

$
0
0

  I would like to convert and move 8 bit data in one SRAM buffer into 16 bit data in another SRAM buffer.  The data bytes can be twinned, as I will be interpolating using the Digital Filter Block later on.

  I have used DMA to move data from SRAM to Peripheral, and Peripheral to SRAM, but early on my attempts to move from SRAM to SRAM did nothing.  I'm sure I will figure it out now, since I *have* to. <grin>

  I would like to do this at as high a speed as possible.  I guess I could DMA into a register and then DMA out of a register; however,  PSOC only supports 8 bit registers.  

   Any suggestions?

  Thanks in advance!

Problem with SPI salve in interrupt mode

$
0
0

Hi everybody..

I am trying to receive 3 words of 16 bit each in a SPI slave from a master using interrupt on the slave side. Both master and slave are implemented on separate PSOC5 development kits. In the 1st PSOC kit(SPI Master) I am receiving some data from a GUI through UART and displaying it on LCD. Then I am sending 3 words of 16 bits through SPI master.

On the other PSOC kit I am trying to receive the words with SPI slave using interrupt and display it on LCD. From the SPI master data is sent correctly.On the SPI slave side the interrupt is getting generated correctly but the data received is random.

All the four lines(CS,CLK,MOSI,MISO) of SPI Master are connected to corresponding lines of slave.Please suggest if some hardware settings are wrong or the code itself.  Thanx in advance. Please find the attached files.

 

 

UART 2.50 CRC Outputs

$
0
0

I have the UART CRC outputs enabled, These going to the CRC generator.

However, I don't see the RX clock coming. Is this not generated by the UART?

Thanks.

GR

Program GPIO on CY8CKIT-042.

$
0
0

Hi All,

I would like to control GPIO pins on CY8CKIT-042 which used CY8C5868LTI-LP039 as its controller.

I used C# software and SWD protocal could program PSOC4.

Is there any dll or library that I could use my software to control GPIO(P5LP3_6/P5LP3_7)?

Many thanks for your help.

 

Ben

Heart Rate Monitor using Counter

$
0
0

Hi all,

I am trying to make a heart rate monitor, which takes in the analogue signal of heartbeat pulses, processes them through a comparator to get a square wave, and input it to a Counter to measure the frequency of each pulse, calculate the no. heartbeats per minute, outputs it to two 7 segment LED displays. The analogue signal and 7 segment LED display works fine, and I suspect the problem is with the Comparator and the Counter. Attached here are the codes and schematics for this project, referenced from this page: http://www.cypress.com/forum/psoc-3-device-programming/frequency-measure... . There is no problem compiling and programming it to my PSoC, but I can't get a proper value for my no. heartbeats per minute, all it shows on my 7 segment LED display is 00. I am not sure if I have configured the Comparator and Counter properly in the schematic diagram, counted the frequency in a wrong method, or if I had coded anything wrongly in my main.c code file. Any help to detect what's wrong with my program is greatly appreciated, thank you! :)

MDIO support on PSoC5 using Creator 4.0

PWM missing triggers


support for Develop control Kit for Burner

$
0
0

Hi,

I want to develop control unit for burner,  kindly advise me, which board kit is near to match my requirements .!

 

I want to control burner flame with pressure and temperature sensors and three units are attached with burner working.

1: System start up with ( control : Monitor pressure and Temp by sensors )
2: Glow Plug 12v 17A (control : switch on/off with timer + Temp sensor )
3: Blower fan 12V 11A, ( Control : switch on/off + PWM variable speed + temp sensor
4: Fuel Pump 12V, 4A, PWM ( Control : Switch on/off + variable speed + temp sensor

Burner system will start up when Pressure and Temp will reached at desired level.
1st glow plug will on for produce flame , 2nd blower will on with low flow, 3rd fuel pump will on for produce continuous flame,

1: MCU 32Bit Cortex M4 200Mhz
2: Flash 2mb + Accelerator
3: Ram 512
4: 2USB + 2 CAN
5: Ethernet IEEE 1588
6: ADC 8
7: Power on/off 6 Mofsets
8: Temperature Sensor 6
9: Pressure Sensor 6
10: Jtag header
11: TFT controller + LCD
10: I/O 20
11: Multi Function Alarms 4 +RTC
12: PWM 8

 

Awaiting your helpful reply.

Regards
Sami

PWM output as clock for Counter on PSoC 5LP??

$
0
0

Hello,

I am using a PWM component to generate a signal around 40 kHz on one pin.

However, I don't need a continuous signal, I need instead a signal every minute or so (triggered by software) of only 1-32 pulses.

Now I wanted to use a counter and use the PWM signal a trigger for the counter, but the counter doesn't like the signal as clock input.

What I can do about it?

Mark

CAN Rx buffer initalize in PSOC5lp

$
0
0

How can i initialize CAN Rx Buffer in psoc5lp. I want to initialize so that i can avoid reading garbage value. I am not using CAN interrupt to copy the buffer content  rather i am polling each acceptance filter .

Thanks

SPI communication with SN65HVS882

$
0
0

Hi,

Trying to get a 5LP communicating with a TI SN65HVS882 Serializer.

I am basiclly using the sample SPI code to test but not seeing any data on the lcd. Any suggestions?

CODE:

int main()
{
    uint8 i = 0u;
   
    /* Software buffers use internal interrupt functionality to interact with
    * hardware buffers. Thus global interrupt enable command should be called
    */
    CyGlobalIntEnable;
   
    /* We need to start Character LCD, SPI Master and Slave components */
    LCD_Start();
   SPIM_Start();
   
    /* SPI communication is provided in Mode 0. So, the first byte
    * should be written directly to the SPI Slave
    */
///    SPIS_WriteTxDataZero(0x11u);
   
    /* We need to know the moment when SPI communication is complete
    * to display received data. SPIS_SPI_DONE status should be polled.
    */
 //   while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));
   
    /* SPI communication is complete so we can display received data */
    while(1u) {
    LCD_Position(0u,0u);
    LCD_PrintString("SPIM Rx data:");
   
    LCD_Position(1u,0u);
     ld_Write(1);
    for(i=0u; i<8u; i++)
    {
        /* Read from SPIM Rx software buffer */
        LCD_PrintHexUint8(SPIM_ReadRxData()); 
    
    }
      // ld_Write(0);
    CyDelay(400u);
    ld_Write(0);
    LCD_ClearDisplay();
   
    };
 
   
  
}     
 

 

Controlling multiple bidirectional pins through function parameter

$
0
0

I am working with DHT11 temperature/humidity sensors and have one working like a charm. It uses a one-wire interface, so I need to both read and write the data pin. At the moment I have a function written that calls the pin name directly, but I'm trying to extend this to be able to handle four sensors. Since I have multiple reads/writes within the function I don't want to do an if/else or switch every time I need to access the pin. THe problem is that I don't know how to go about making the function generic so I can pass in the sensor number and have it work only with the correct pin. I looked at the aliases available for pin names, but I can't figure out how (or if it's even possible) to use a function parameter to indicate the correct alias to use with the CyPin​s_setpin(<alias>) function(s). I also looked at the Mux/Demux, but they are unidirectional so I don't think they'll work. 

I don't feel like this post is very clear, but I'm having a difficult time coming up with better phrasing. I've attached a rough idea of what I'm trying to accomplish which will, hopefully, clarify things. 

Any guidance on the correct way to approach this would be great. 

Regards,

Matthew

Attachments: 

Miniprog3 Cannot Acquire PSoC

$
0
0

Hello everyone.

I made a simple board using a PSoC 5LP. In order to program it, I planned on using the MiniProg3 with SWD over the 5-pin connector via the Reset method. However, I am unable to program the device. I have attached screenshots of the PSoC programmer and the schematic for the board. It seems like the MiniProg3 can detect the target voltage (5V), but not the target device.

Any thoughts are appreciated. Apologies for the messy schematic :)

analog mux sequencer with delta sigma converter

$
0
0

I'm trying to use the analog mux sequencer to mux two channels into a delta-sigma converter.    I cannot get it to work- tried multisample mode, start/stop convert etc, but no go.   I tried  an SAR converter and it worked first try.

Why does it work with the SAR but not with Del-Sig converter?

Attached is the project archive


I2C Master doesn't work.. need help..

$
0
0

Hello together,

 

i have an SDP601 Sensor http://www.mouser.com/ds/2/682/Sensirion_Differential_Pressure_SDP6x0ser...

The Sensor uses I2C to communicate. I have connected the Sensor to a PSOC 5LP Development Board but it doesn't work. 

#include <project.h>
#define I2C_SLAVE_ADDRESS    (0x40)
    uint8 temp;
    uint8 status;
    uint8 Sensor_Command = 0xF1;              // Command for Sensor
    uint8 Sensor[3];
    uint8 i= 0;
    uint8 j= 0;
int main()
{
    CyGlobalIntEnable; /* Enable global interrupts. */
    LCD_Start();
    I2C_Start();
   
    status = I2C_MasterSendStart(0x40, I2C_WRITE_XFER_MODE);
    if(I2C_MSTR_NO_ERROR == status)   /* Check if transfer completed without errors */
    {         
        status = I2C_MasterWriteByte(Sensor_Command);
    }
    status = I2C_MasterSendStart(0x40, I2C_READ_XFER_MODE);
   
        Sensor[0] = I2C_MasterReadByte(I2C_ACK_DATA);
        status = I2C_MasterStatus();
        Sensor[1] = I2C_MasterReadByte(I2C_ACK_DATA);
        status = I2C_MasterStatus();
        Sensor[2] = I2C_MasterReadByte(I2C_ACK_DATA);
        status = I2C_MasterStatus();
    I2C_MasterSendStop();      /* Send Stop */
    LCD_PrintInt8(Sensor[0]);
    LCD_PrintInt8(Sensor[1]);
    LCD_PrintInt8(Sensor[2]);
 
   
    while(1)
    {
   
    }
}
 

 

I tried many other code but it will not work. What can I do? Can you write working example Code?

 

SCL is connected to P0[0] SDA is connected to P0[1]

The LCD is connected to P2[0]-P2[6]

PSoC5 blood glucose monitoring on EDN

Passing different parts of variable to different variables with DMA

$
0
0

Hello. I am working on a project where i need to pass information from one variable to three different places, for this i am using three DMA's.

What i need to pass is the output information from a DAC, stored in "*ADC_DEC_SAMP_16B_PTR" and then it to my PWM compare variables.

The thing is that the PWM module cant do what i want, and therefor i am combining two PWM modules. For this i am using this:

http://www.cypress.com/blog/psoc-hacker-blog/high-resolution-high-freque...

It is working as it should, but now i can not just pass my ADC information directly to the PWM compare value, as i need to pass the MSB part of the variable to two inputs, and the LSB part to an other input. 

I hae tried to use HI8 and LO8 to pass the right part, but i am not sure that i am doing the right thing (i am sure, as it does not work), and i am completely lost. My first DMA is set up like this:

    void DMA_Config_1()
{
    /* Defines for DMA_1 */
    #define DMA_1_BYTES_PER_BURST 1
    #define DMA_1_REQUEST_PER_BURST 1
    #define DMA_1_SRC_BASE (CYDEV_PERIPH_BASE)
    #define DMA_1_DST_BASE (CYDEV_PERIPH_BASE)

    /* Variable declarations for DMA_1 */
    /* Move these variable declarations to the top of the function */
    uint8 DMA_1_Chan;
    uint8 DMA_1_TD[1] = {0};

    /* DMA Configuration for DMA_1 */
    DMA_1_Chan = DMA_1_DmaInitialize(DMA_1_BYTES_PER_BURST, DMA_1_REQUEST_PER_BURST, 
    HI16(DMA_1_SRC_BASE), HI16(DMA_1_DST_BASE));
    
    DMA_1_TD[0] = CyDmaTdAllocate();
    
    CyDmaTdSetConfiguration(DMA_1_TD[0], 1, CY_DMA_DISABLE_TD, CY_DMA_TD_INC_DST_ADR);
    
    CyDmaTdSetAddress(DMA_1_TD[0], HI8((uint32)(ADC_DEC_SAMP_16B_PTR)), LO16((uint32)PWM_2_COMPARE1_LSB_PTR));
    
    CyDmaChSetInitialTd(DMA_1_Chan, DMA_1_TD[0]);
    
    CyDmaChEnable(DMA_1_Chan, 1);
}

 

The other DMA's is set up in an equivalent way.

 

My output with the DMA's is different than my output with them (Without DMA's i have 50% duty cycle as expected). Pictures is attached.

This means that i am passing some kind of data, but it does not change with the input signal.

 

Can anyone give me a hint?

Need help regarding implementation of 2 PWM blocks using PSOC 5LP

$
0
0

Hello

 

I had some questions regarding the implementation of two PWM blocks in parallel.. It’s a simple implementation.This my first time with PSOC 5LP.

I know how to enable a PWM block using “PWM_1_Start();” in the “main.h” file but when I’m using the second PWM block then its giving an error with the “PWM_2_Start();” command. I read somewhere that I have to enable a control register somewhere but cant figure out where to do it.

 

I just need to enable two PWM block synchronously at a fixed frequency and 50% duty cycle.

 

Regards,

Sid

Data transmit to external D/AC using I2C

$
0
0

Nice to meet you. Thank you for seeing.

Please teach me how to transmit data to external 16 bit A/DC (AD5696, Analog Devices) by using I2C master in PSoC 5LP. I programmed C firmware refer to Sample Code "DelSig_I2CM" in PSoC creator, not only A/DC didn't work , but also SDA and SCL signal have been seen using oscilloscope. I think C firmware is highly likely to be wrong, but I couldn't understand reason.

------------------------------------------------------------------------

/* Parameters used:
*  I2C Master
*   Implementation      Fixed function
*   Data rate           400kbps
*   SDA SCL pin config  Open drain, drives low
*   Pull-up resistors   1.6k each
*
*  Delta Sigma ADC
*    Resolution            12 bits
*    Conversion Rate       1000000 SPS
*    Input mode            Single ended
*/

#include <project.h>
#define I2C_SLAVE_ADDRESS    (12u)
#define WR_BUFFER_SIZE       (2u)

uint8   X_IN = 0u;
uint8   temp = 0u;
uint8   sample_segment[WR_BUFFER_SIZE];
uint16  result[3] = {0u};

int main(void)
{
    ADC_SAR_IN_Start();
    ADC_SAR_IN_StartConvert();
    I2CM_Start();
    CyGlobalIntEnable;
    
    for(;;)
    {   
        ADC_SAR_IN_IsEndConversion(ADC_SAR_IN_WAIT_FOR_RESULT);
        result[X_IN] = ADC_SAR_IN_GetResult16();
        sample_segment[0] = result[X_IN] >> 8u & 0x00FFu;
        sample_segment[1] = result[X_IN] & 0x00FFu;
        do
        {
            temp = I2CM_MasterWriteBuf(I2C_SLAVE_ADDRESS, (uint8 *)sample_segment, WR_BUFFER_SIZE, I2CM_MODE_COMPLETE_XFER);
        }
        while(temp != I2CM_MSTR_NO_ERROR);
        while(I2CM_MasterStatus() & I2CM_MSTAT_XFER_INP);
        temp = I2CM_MasterClearStatus();
    }
}

Viewing all 387 articles
Browse latest View live


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