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

Bootloader on RS485 with PSoC5LP

$
0
0

Hi,

I'm developing a project on a PSoC5LP and I have to use a RS485, in the past I developed the same project with RS232 and the bootloader is very good and fast, but now, when I try to use RS485 (with TX_enable pin) I have a lot of problems, I always have this error message: "CYRET_ERR_DATA : The data is not of the proper form". Is there something that I have to add if I use RS485 instead of RS232?

Thank you for the time you'll decide to give me.

bye


Intergrating a LIDAR (VL53L0X) over I2C

$
0
0

Hi Forum

 

As part of my project I would like to be able to read the output of a LIDAR sensor on a serial monitor over the I2C bus, using a PSoC 5LP. (Linked below)

http://www.st.com/content/ccc/resource/technical/document/datasheet/grou... (LIDAR datasheet)

I found a post that took the ardunio libraries and converted them to PSoC 4 libraries. (Linked below)

https://www.hackster.io/vlad-radoiu/measuring-distance-with-vl53l0x-tof-...

I have the serial monitor part working however I cannot get the sensor to initiate. I had an printf after the initialization of each component (Timer and I2C block) showing the place where the program hangs. (picture attached)

Any help on whether this is a bug in my code or a hardware issue would be greatly appreciated.

Below is attached my workspace archive (Minimal) and an image of what is displayed in PuTTy

Thanks

 

Floating Point Again

$
0
0

Hi,

I know I've been through this before. I am trying to us sprintf to print floating point numbers. I made the recommended changes to the Build Settings to Use newliv-nano Float Formatting, Addition Libraries m. Still not working. Returns nothing.

It is Creator 3.3 on a PSoC5.

Nick

Windows device drivers for cy8ckit-059

SPIS component for TX Issues

$
0
0

All:

The attached project uses the SpiS component for TX only. The SpiClk is supplied from external input pin.

The SpiSS is controlled using a control register.

The block of data is just a buffer preloaed with data 0 thru 50.

The OScope screens show that it takes the SpiS 16 SpiCLk to tranfer each bit.  Channel 1 is SpiClk, Ch3 is the data.

I am attaching only two screen shots (Xfer of 0x01 and then 0x03).

What am I doing wrong?

Appreciate any insight into this issue.

Giri

 

cant recognize device on reset

$
0
0

I pressed the reset/xres switch on a cy8ckit50 (psoc5) board and now windows and psoc creator cant recognise the device. What is the fix for this?

em_eeprom questions

$
0
0

I would like to make an 8k block at top of flash for eeprom. I see where bootloadable can be set to allow this. What's confusing is the examples only show setting up small arrays and filling them without any regard to memory address, etc. I want to set up something more organized like the smaller eeprom component where you can define fixed addresses. I guess I want to tell the linker where I want my em_eeprom arrays to reside or maybe just create one big 8k array and then index into it as needed. Any suggestions?

Can't enter debug.

$
0
0

I've been playing with the Sparkfun FreeSOC2 for about a day, and everything was going well, but now it's "stuck" and I can't enter debug.

I can program the device, but after that I get a message "The start request failed. Encountered error (SetTarget timeout)"

Tried resetting the board, power cycle etc.

How do I recover?


SAR ADC streaming to USB UART

$
0
0

Hello, 

I need to take samples from SAR ADC at constant rate of 100Ksps and resolution of 8 bits. I read the datasheet of the ADC and relevant ANs (Starting with DMA, ADC buffering using DMA, DMA advanced topics, etc...). For the samples logging I used the "Teraterm" software. Before starting the design, I wrote a small program which sends data via USB UART and saw that it rate is about 230 KBytes/sec, which enough for ADC with 100Ksps  of  8 bits/sample .

I saw a lot of examples, while most of them take some amount of samples from ADC, stop sampling and send the samples via DAC or serial interface. This kind of solution isn't good for me, I need a constant sampling rate, I can't lose samples. The only similar example to my case was EP8353 ("ADC to Filter – Dual Channel 16-Bit Streaming using DMA"), but there the author didn't sent the samples via USB UART.

My idea is using 2 DMA channels, while ADC writes to the one of them, I am reading from the second and vice versa (in my previous design I did the same trick using one common array and one DMA, the result was the same.. :-( ). The data that I got wasn't as expected, it seems that there is overlaps..., and some missing writes to register (data that sent was from previous filling of the same register, please see attached picture). 

The results are better (but not perfect) at sample rate of 10 Ksps than 100Ksps.

I thought about few solutions (but I assume that there is more elegant solutions...)

1. I thought about using intermediate register as described  AN61102 ("ADC Data Buffering Using DMA", page 16), but I don't fully understand how this serial process can help, while I try to implement a parallel process (I try to live more time to USB UART if there will be any delay, due to flow control for example...?)

2. I afraid that the bit rate using USB UART with TeraTerm isn't constant (maybe average rate is sufficient but the momentary is not) and I need to use full USB part..?

3. Adding local memory..., too complicated.

If you can share some ideas how to implement streaming of  100Ksps, 8 bits/sample ADC's data via USB UART it will be great.

Thank you.

Alex.

Looking for source code (frequency measurement)

Control Register (logical) error in PSoC 5

$
0
0

Hi,

I use the PSoC 5LP CY8C5868AZI-LP035 to generate a 3 phase sine wave with 3 external DACs with an SPI interface. So, as suggested in the documentation, I have a firmware controlled setup where i enable each DAC when required. 

I use a 3bit Control register and the problem is that i am not able to activate each line in sequence, ie, CR_Output1, followed by CR_output2, ending with CR_Output3. I can do so, however, when i give a certain delay between their enabling, but when i do so without any delay, the 3rd output selects when im actually selecting the 2nd output and vice versa. 

So, to enable them, the input to the API is,

0x06, 0x05 and 0x03, this should lead to Line1, Line2 and then Line3, but what happens is: Line1, Line3, Line2.

So i have to exchnge the input as: 0x06, 0x03 and 0x05, which somehow works, and i dont know why.

Any help would be appreicated.

Thanks in advance.

PRP

Build a co-processor in UDB with Verilog in PSOC 5LP?

$
0
0

Hi, 

I am looking for example designs which uses the UDB in 5LP to work closely with the CPU. 

I need to write 32b data to UDB and read from result from the UDB. My verilog in UDB will do some custom computation. The closest I saw on the Cypress is the fan control but it uses functions like FanController_GetActualSpeed, is that an API or do I have access to the source codes? 

Are there any ref designs which uses the registers in UDB like memory mapped registers? 

Thank you! 

 

Bootloader Data Error on Program Row Command

$
0
0

Hi,

I am writing a bootloader host program but am having trouble with the Program Row (0x39) command. I keep getting a BOOTLOADER_ERR_DATA 0x04 response when trying to send a row of data. I am using Qt to parse the cyacd file.  

QString line = textStream->readLine();
  //validate row
  if(line.at(0) != ':')
  {
    log->error("cyacd file error");
    return;
  }
  else
  {
    line.remove(0, 1);
    QByteArray row = QByteArray::fromHex(line.toLatin1());
    
    //Copy out arrayID, rowNumber, datalength
    memcpy(&rowData, row.data(), 5);
    //convert from big endian
    utility::swapBytes(rowData.datalength);
    utility::swapBytes(rowData.rowNumber);

    rowData.checksum = row.at(row.size() - 1);
    rowData.data.resize(rowData.datalength);
    memcpy(rowData.data.data(), row.data() + 5, rowData.datalength);

    if(rowData.datalength != row.size() - 6)
    {
      log->error(QString("error with data row length expected %1 got %2").arg(rowData.datalength).arg(row.size() - 6));
      return;
    }
...

I noticed in the PSOC reference code they chunk the data using the SEND_DATA(0x37) command. Is there any issue in sending the entire row using PROGRAM_ROW(0x39)?

do we pay if we use emFile in our design?

$
0
0

I observe that emFile is from another company other than Cypress. If one makes a commercial product with PSOC and uses the 

emFile for file storage, do any fees payable to segger apply? 

 

Windows device drivers for cy8ckit-059


emwin GUI_Init() takes 10 seconds to complete!

$
0
0

The emWin library requires running GUI_Init() before calling any other GUI functions, but it takes 10 whole seconds to complete!  This product cannot be released to the public until this bug is solved.

When I pause the debugger, I see the call stack is
main()
GUI_Init()     <- emWin function, no source
LCD_Init()     <- emWin function, no source
LCD_FillRect()     <- emWin function, no source
...      <- more emWin functions, no source

And the specific paused instruction is a Cypress generated function, LCD_1_Write, with an incrementing value (to fill the rectangle)
LCD_1_Write( 632341, 0)
LCD_1_Write( 632342, 0)
LCD_1_Write( 632343, 0)
etc.

Does anyone else have this problem?   I don't know why it's filling the rectangle (I assume it's clearing the background, but I don't need that "help" and it shouldn't take 10 seconds to clear the screen buffers).  I am using virtual screens in external RAM (480x272 LCD with 8 virtual screens).

Does anyone have any guesses?

Thanks!

How to use free RTOS to control device

$
0
0

Hello

I am looking help on real time operating system. I am just beginner and I don't understand how to use free RTOS . so  I decided to start with small example. so I want  to control the three DCs motor under  the control of free RTOS. so I have gone through free rtos site but I don't understand how to use free rtos file to control three DC motors. I know ,I don't need free rtos to control three dc motors.  its just for practice 

Bidirectional SPI - only slave communication works

$
0
0

Hi,

I am currently using the PSoC 5 development kit (CY8CKIT-050).

I am unable to communicate in both directions. I wrote a simple program where the master reads the slave data, subtract one and writes it so the slave and the slave reads the master data, add one and writes it so the master. So I got two loops. One loop should count up and the other should count down. When I display both values, both are the same and both loops are counting down.

Thanks

Attachments: 

SPI communication

$
0
0

Hello,

I am trying to communicate with a transceiver over SPI. I am using 16 bit values to transmit data over miso and mosi. I have a sallie logic analyzer that shows that sallie is reading the right values being exchanged. However, when I try to read these values from the SPI Master I am not getting values that make sense or match the Sallie commands that are on MISO. I am using an interrupt that fires when the buffer is not empty. This value will read to a data structure. 

 

For example:

CY_ISR(RX_INTERUPT_Interrupt)
{
    /*  Place your Interrupt code here. */
    /* `#START RX_INTERUPT_Interrupt` */
   
         TS_one->Read = SPIM_1_ReadRxData();//store response in TS2 array
        
        
    /* `#END` */
}

I send a command like SPIM_1_WriteTxData(0x9700);

Then I want to get what comes back on MISO to be stored in TS_one->Read. I know the right data is sent back due to using Sallie. After the data is written to TS_one I will move it into a different variable and loop again.

 

 

Digital Filter Block and 16bit DMA

$
0
0

I am trying to run a 16bit conversion from the Delta Signal ADC to the DFB using DMA. I have set everything up as best I can but I can not get the Filter Interrupt to fire. I have confirmed the DMA transfer is working by monitoring the DMA nrq output. I get pulses at 2khz which is the speed I am running the ADC.

I then loaded the example Filter_ADC_VDAC project and it fires the interrupt fine.

I use the DMA wizard initially in my project any it wants me to use Filter_1_STAGEA_PTR for the destination of the DMA transfer.

If I change this to Filter_1_STAGEAH_PTR like in the example project the interrupt starts to work. However, when I read the filter

Filter_1_Read16(Filter_1_CHANNEL_A);

it looks like the output is just random data. I am feeding a constant 2V to the ADC.

Does anyone know why when I set the DMA destination to Filter_1_STAGEA_PTR the interrupt no longer works?

The DMA wizard created this

CyDmaTdSetAddress(DMA_1_TD[0], LO16((uint32)ADC_AirSpeed_DEC_SAMP_PTR), LO16((uint32)Filter_1_STAGEA_PTR));

Is it wrong?

Here is the DMA config functions

uint8 DMA_1_Chan;

uint8 DMA_1_TD[1];

/* 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], 2, DMA_INVALID_TD, DMA_1__TD_TERMOUT_EN);

CyDmaTdSetAddress(DMA_1_TD[0], LO16((uint32)ADC_AirSpeed_DEC_SAMP_PTR), LO16((uint32)Filter_1_STAGEA_PTR));

CyDmaChSetInitialTd(DMA_1_Chan, DMA_1_TD[0]);

CyDmaChEnable(DMA_1_Chan, 1);

 

Viewing all 387 articles
Browse latest View live