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

Transmitting current time stamp along with data to display by using lab view

$
0
0

Dear all,

I am using  CY8CKIT-059lp kit .  I am transmitting data through UART . I want to add current time stamp along with my data in microsecond resolution. So that, at the receiver data end I can save both data and corresponding time in txt or excel format and can plot the graph using LAB View. kindly help to write the code.

 

Thanks

Chandan


Locate array in SRAM

$
0
0

Hi everyone

I'm trying to get working a project  which transfer data from SRAM  Buffera[166] to DFB  and DFB to  SRAM  Bufferb[166] using two DMA components.

I would need some help to set the above mentioned buffers at address 0x20000000  and 0x2000014E.

 Using   int16 myVar[166] _at_ 0x20000000  produce compiler error.

Thank you very much for any help.

 

Problem Programming with MiniProg3

$
0
0

I have a board with a PSOC5 CY8C5268AXI chip that I am trying to communicate with using a miniprog3, I am using external power, SWD communication via the 5-pin connector. I can get it to recognize the chip and connect but then it looses connection and cant find it again without repowering the miniprog3. 

See video of issue here: https://www.youtube.com/watch?v=5I-JARF-0Hs 

I am new to the Cypress PSOC so I don't know what is normal to compare the behavior to.

 

I2C communication problem with a light sensor.

$
0
0

Dear all,

I'm new on PSoC and I got a problem of communication between a light sensor TSL2561 and my PSoC 5

(here the doc of the sensor : https://cdn-shop.adafruit.com/datasheets/TSL25911_Datasheet_EN_v1.pdf )

I can see the buffer on the debug mode but theres are empty, and my sensor don't write his data inside. The datasheet of the sensor talk about perform a four-byte I2C read operation using the auto-increment in the page 17, but I don't understand what is this.

 

My code :

#include <project.h>

#define TSL_ADDR    0x29

int main()
{
    CyGlobalIntEnable; 
    uint8 mwbuff1[7];
    I2C_Start();

    for(;;)
    {
        I2C_MasterReadBuf(TSL_ADDR,mwbuff1,7,I2C_MODE_COMPLETE_XFER);

        CyDelay(500);
    }
    I2C_Stop();
}

 

So what I have to add in my code, for read the light sensor's data.

 

Thanks.

Jacque

 

Warning: sta.M0019: USB_UART01_timing.html: Warning-1366: Setup time violation found in a path from clock ( CyBUS_CLK ) to clock

$
0
0

I run across this problem on some of my PSOC 4 and PSOC 5 designs.  Usually I slightly change the processor clock speed and problem goes away.

I am currently trying to setup a clock for 2 ( 32 bit counters ) and a status register.  The value of the timer would be on the order of 1 khz.  I get a setup warning on the clock.  Not sure what the warning is about and not sure how to systematically solve or handle this warning.

 

 

 

Youtube tutorial troubleshoot

$
0
0

I'm trying to follow tutorial https://www.youtube.com/watch?v=oq8eQhvkceM

Problem is my measured output shows not like input. I tried to match pins to my device PSoC 5 LP board. But, how to differentiate between ADC channels?  For example, OpAmp has opamp_0, opamp_1 etc for determining hardwired output pins. How does this work  for ADC?

Here is screen of my design

http://tinyurl.com/h2k6r9u

 

Changing speed of SPIM in code (5LP)

$
0
0

Hi,

Just a quickie, how do you change the SPI speed in code?

I am interfacing with a device that needs the SPI to run slow (3MHz or less) and then later switched to high (up to 20MHz).

Changing CAN receiver id

$
0
0

How do i change the id of a particular receiving filter in CAN through code itself? The device i am using is psoc5lp.

 

Thank you


larger fifo for shift register

$
0
0

Hi,

i am trying to work with a 5Mbit/sec serial input and load it into a cyclic buffer i created in code. later in processing the data is sent over USB.
My problem is the FIFO depth. the code is just not fast enough to do something useful with the data and come back in time to prevent the  over flow. 

is there a way to chain fifo's ? would writing in verilog help ?

(i am using the CY8CKIT-059 PSOC5LP)

 

Having problems with I2C error checking,

$
0
0

Hi,

I’ve been working on I2C communication between a PSOC 5LP (master) and multiple PSOC 4’s (slaves). This is being done with a Cy8CKIT-059 and multiple Cy8CKIT-049-42xx boards. The goal is to be able to add a slave device to the bus, in a default configuration with address 0x08, and have the master assign it a new address and maintain a list of all currently used slave addresses. The slave stores its address in flash (Emulated EEPROM) so at power up the configuration remains unchanged. For now, the part about having the master store a list of addresses has been set aside and I’m just sending commands through USBUART via a terminal.

Most of this project is functioning correctly, but I’m running into a few hiccups that really come down to error checking. There are also some parts of the code that aren’t exactly elegant, but thus far my goal has been to just get things working, so please excuse them. I have attached a zip with the main.c and main.h for both the master and slave. My questions are:

 

1. I am using the I2CMasterWriteBuf and I2CMasterReadBuf API functions and they are working well. My problem is that these API functions are returning “SCB_I2C_MSTR_NO_ERROR” when they try to talk to a slave address that does not exist. I am clearly not understanding how the return value of the functions is created and would like to be able to find out if a slave is not on the bus and generate an error.

 

2. The second concern is regarding sending a save device a command to change its address. I am currently using a simple block check to validate packets, which is working as expected. I would like to find a way to generate some kind of acknowledgement from a slave saying that the incoming packet is valid before executing its address change. This way the master knows the packet was received correctly and can update its slave address array accordingly.

As of now if the block check isn’t correct the slave will not attempt to update its address, but the master has no way of knowing that this did not happen. The only way I can do this right now is to attempt to read from the new slave address and see if the correct status value is returned, indicating a successful address change, though if the address isn’t there I run into the previous problem. This can be worked around by checking that the status in the returned packet is correct, but it feels a bit like going around my elbow to get to my rear and, frankly, I don’t really like it.

I’m currently using the MasterWriteBuf and MasterReadBuf functions with the mode set to “MODE_COMPLETE_XFER” which I have a hunch is part of the problem. I feel like I need to use the “MODE_NO_STOP” mode, but I don’t understand how this works and can’t seem to get things working with it.

 

 

I’m new to Cypress devices as well as I2C. Any help with understanding where my logic is incorrect or guidance to a solution would be greatly appreciated. If anything isn’t clear I’ll be happy to try and resolve any ambiguity.

 

Thanks,

Matthew

Dynamic UART flow control on PSoC 5LP

$
0
0

Hello,

I'm using a PSoC 5LP to communicate with another processor over UART. That other processor does in one scenario require flow control, and in another scenario is unable to use flow control.

Is there any way to enable/disable flow control from code?

 

Thanks, Jacob

Unable to program custom PCB PSoC 5LP using miniprog3 10 pins connection

$
0
0

Hi All,

I had custom PCB with CY8C5868AXI-LP035. I programmed CY8CKIT-50 using miniprog3 with success. When I connected miniprog3 10 pins config to custom PCB, the target is detected but the programming fails with the message "Error: dbg.M0023: There was an error while programming the device: Connection with device lost during programming. Verify the device is connected and try again". I have checked the voltage levels at all the power pins which is stable 3.3V and 1.8V on VCCA & VCCD. I had set the voltages to the power pins to 3.3V in the system page of Design wide resources. Please find the attachment containing PCB gerber, schematic, detection image, error image,  and project files. Appreciate any assistance.

Interpolating DAC samples, or using 2 sar's simultaneously.

$
0
0

    I am using the 1msps SAR to get around 8 samples per waveform of an echoed 120khz signal. (used in material examination).  It is working ok.

    Unfortunately the internal DAC can only do 8 bits, so when playing the 12 bit signal back at a slower rate using the 8 bit DAC, to be used in other equipment, the loss of resolution is affecting the waveform amplitude between echo samples, as you would expect.

    One possibility would be to interpolate data to play out the DAC and derive more samples.  If the sample rate is computationally doubled, this would provide a stable enough signal.  I am trying to wrap my mind around that one, and have not seen any C examples.  I think I can do it, but I'm still a bit confused about getting the missing Y value for an X from the formulas I've seen.  My brain is missing something in addition to gray matter.

   The other way to do it would be to offset using 2 SAR's exactly 1/2 so that one gets one sample and 500us later the other SAR would get the other sample.  I could interleave the samples and shift out the DAC.  So, it leads to the following questions:

   1) Any C code for interpolation I could be pointed to that is geared for getting missing DAC samples.  (Linear interpolation is obvious, cosine, maybe, Levinson-Devinson sounds good)

  2) Any examples of shifting the SAR's so they are offset from each other exactly half?  Any luck doing the DMA in that configuration?  I have DMA running, but I've found that the PSoc sometimes lays down like a sick puppy if the DMA's are too busy.

frequency to voltage conversion

$
0
0

I am transferring multiple analog voltage measurements through optic fibers, thus i convert the analog signal in to variable frequency (square wave pulses through V/f converter). On the receiver end i want to avoid the hardware f/V conversion and i would like to achieve this through PSOC, as i want to process these measurements without the need of the ADC. 

Any suggestion is much appreciated! 

/Dimz

Linker Not Called

$
0
0

I am having an issue with PSoc Creator 4.0 Update 1 where it does not properly detect when a link is required. If I change a .c file and select build project, it compiles the c file but then said the link step is up to date and does not link in the changes. Here is an example output. As you can see I changed PIDControl.c so it compiled the file but then the linker was not called.

Does anyone know what would cause this?

--------------- Build Started: 03/19/2017 09:12:51 Project: MacanumBuggy, Configuration: ARM GCC 4.9-2015-q1-update Debug ---------------

The code generation step is up to date.

arm-none-eabi-gcc.exe -mcpu=cortex-m3 -mthumb -I. -IGenerated_Source\PSoC5 -Wa,-alh=.\CortexM3\ARM_GCC_493\Debug/PIDControl.lst -g -D DEBUG -Wall -ffunction-sections -Og -ffat-lto-objects -c PIDControl.c -o .\CortexM3\ARM_GCC_493\Debug\PIDControl.o

The link step is up to date, no work needs to be done.

cyelftool.exe -C "Z:\Programming\Cypress\RC Projects\MacanumBuggy.cydsn\CortexM3\ARM_GCC_493\Debug\MacanumBuggy.elf" --flash_row_size 256 --flash_size 262144

cyelftool.exe -S "Z:\Programming\Cypress\RC Projects\MacanumBuggy.cydsn\CortexM3\ARM_GCC_493\Debug\MacanumBuggy.elf"

Flash used: 37572 of 262144 bytes (14.3 %).

SRAM used: 3957 of 65536 bytes (6.0 %). Stack: 2048 bytes. Heap: 512 bytes.

--------------- Build Succeeded: 03/19/2017 09:12:54 ---------------

 

 


emWin drawing .bmp images from external Flash

$
0
0

I'm attempting to use the emWin function GUI_BMP_DrawEx() to draw a .bmp image stored in external Flash onto a window. I've also implemented a getData() function as shown in the examples.

If I try to draw an image onto the background window using GUI_BMP_DrawEx() everything works as expected. The getData function gets accessed several times and the image is correctly displayed.

However, if I try to call the same function from within the WM_PAINT case in a window's callback function, it will go in the getData() function and read the first 54 bytes as expected, but when it goes back in to getData() the second time the Offset is not 54 but rather some random value. The program then continues to use the getData() function to read from flash but the offset value is always different and random. It never returns from GUI_BMP_DrawEx().

Strangely, if I call GUI_BMP_DrawEx() from the WM_INIT case, the function will call getData() once and then return immediately. In either case the images do not get displayed.

I don't understand this behavior. Any help would be greatly appreciated.

Thank you,

Measure time period of PWM pulse

$
0
0

Hello everyone.

I am a newbie at using the PSoC.
I need to measure the time period of an external PWM signal using PSoC5, but I am finding it hard how to use the counter. How to i configure the counter, and how do I connect the ports on the counter? 
The PWM signal varies from 500Hz to 5kHz, and I want to find the time period from rising edge on first pulse to rising edge on second pulse.

Example projects would be much appreciate :)

Regards
Frodi

Read CAN Tx Mailbox ID

$
0
0

Is there a way to read a CAN bus mailbox ID that has been set in the configuration window? I know I can use

CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (ID << 21u));

to write a mailbox ID but I cannot find a way to read the ID in the API or seem to locate where its stored in the generated code. Basically trying to read the ID so that I can then modify it based on external inputs. 

finding bootloadable start in map file

$
0
0

When setting the flash protection for a bootloader on a psoc 3 project it's easy to find the bootloader flash start and end from the map file. The map file for a psoc 5 project is not as readable. I'm assuming that the bootloader should be protected from 0000 to the start of the bootloadable same as psoc 3. Where in the map files for bootloader or bootloadable psoc 5 project can I find this? I'm looking for the starting address of flash for the bootloadable so I can set the entire bootloader flash below it to protected.

Sequencing SAR how to make internal connection to input

$
0
0

I have the cy8ckit-059 ,  using the sequencing SAR (single ended),  there's a compile error if  the analog input is connected to an op-amp output internally.  Is the only solution to bring the op-amp output to a pin and also the analog input of the SAR to a pin,  then connect them with a wire externally? (I'm only using one-input for now, but I will be using 2 inputs later).

Why can't there be a direct connection, all internal, from op-amp output (internal) and SAR input ?   I don't have this problem with the Delta-sigma A/D.  Why?

That's all one question.   

Another question- everytime I open the SAR part to configure, it changes the frequency.  Originally  I set it to 1 MHz,  but it reverts to 999.992 kHz  .  

Thanks in advance

Jim

 

 

Viewing all 387 articles
Browse latest View live


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