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

Issues with SPI data transfer between Arduino Master and SPI_S module

$
0
0

Hi,

I've used the SPIS_Example  (Code Example), which saves data using DMA. I've added an interrupt to the DMA_RX (nrq) to notify when the buffer is full and that works fine. When I add an SPI Master module to the slave and transmit the data directly to the SPI slave it works as well.

I would like to send data from an arduino sensor to the SPI slave. The SPI Master was removed and the SPI pins added back. I have the slave configured as CPHA=0, CPOL = 0, MSB First, with buffer sizes of 5. The arduino Uno is set up as shown below:

void setup() {
  Serial.begin(9600);

      pinMode (psoc_ss, OUTPUT);
      digitalWrite(psoc_ss, HIGH);
      delay(1);

  SPI.begin();
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(MSBFIRST);
}

and the data is transfered using the following method

void notifyPSoC(){

Serial.println("Sending floats");

digitalWrite(psoc_ss,LOW);

float curx = -9.9999;
//transfer float
unsigned char *chptr;
 chptr = (unsigned char *) &curx;
  SPI.transfer(0x11u);
 SPI.transfer(*chptr++);
 SPI.transfer(*chptr++);
 SPI.transfer(*chptr++);
 SPI.transfer(*chptr);
 
 delay(10);
 float cury = -9.9999;
//transfer float
unsigned char *chptr2;
 chptr2 = (unsigned char *) &cury;
 SPI.transfer(*chptr2++);
 SPI.transfer(*chptr2++);
 SPI.transfer(*chptr2++);
 SPI.transfer(*chptr2);

 delay(40);
    
 digitalWrite(psoc_ss,HIGH);  

}

 

The issue is the data output from the SPIS module now has no correlation with what is being sent. I have a logic level shifter so that the the arduino can talk to PSoC. Have I missed something obvious?

 

Thanks

 


Sending floats across SPI

$
0
0

Hi,

I have used some sample code to send a float across an SPI connection. To reconstruct the float from a buffer I have used a union.

union{
    float floatx;
    int8 b[4];    
    } x;

x.b[0] = rxBuffer[4];
x.b[1] = rxBuffer[3];
x.b[2] = rxBuffer[2];
x.b[3] = rxBuffer[1];

but when I compare the value sent to the value of x  (x.floatx == -9.9999) they aren't the same even thought the bytes printed on the LCD look correct (in hex). Have I done this correctly?

Thanks 

PSoC5LP Based Sonar Recording System Thesis

$
0
0

Hello all,

I would like to thank the community here for helping me with my technical questions over the years as I have learned a few things about embedded systems programming. My thesis research focused on using one of the PSoC5LP parts to implement a very light weight sonar recording system targeted to be mounted on bats, to record their echolocation calls in flight, and offload the recorded data over an ISM band radio.

 

Maybe some people here might find it interesting to look at, or perhaps it could answer a few questions that some might have.

 

The URL can be found here:

http://trace.tennessee.edu/cgi/viewcontent.cgi?article=5135&context=utk_gradthes

 

Enjoy!

 

Jeremy

UART Pins do not function as GPIO

$
0
0

On the PSoC5 CY8C5888LTI-LP097, there are pins marked UART on 12_6 and 12_7. When I configured these to be regular digital input pins down pull-down resistors, one pin was permanently HIGH and one was permanently LOW. 

I have a UART in my project, but it's TX only and I connected it to 1_7, not 12_6. 

I didn't read anything in the app notes about UART pins.  I'm using the pins marked I2C and they work fine. 

PSoC5 maximum DMA transfer rate from 8-bit parallel port to RAM

$
0
0

I am new to PSoC5 programming and need help to master its DMA data transfer.

I started a project that requires grabbing parallel port camera frame data at fast speed. The camera has 8-bit parallel port, VSync, HSync and Pixel Clock.  Data format is a 8-bit gray-scale. Resolution 320x240 (QVGA).

I started with single channel DMA arrangement. Basic structure is as following:

1. VSync isr resets the line counter and enables HSync interrupt,

2. HSync isr setup the destination line buffer start address in DMA channel, enables DMA and enables DMA done interrupt

3. following rising edge of pixel clock event triggers DMA read from the 8-bit port, write to the destination buffer and increment the destination address

4. DMA channel is set to length of 320

5. DMA done isr increment the line counter, if the line counter reaches the bottom (240), disable further HSync interrupt.

The above process works OK when camera pixel clock is set to 3MHz. The problem is that the above arrangement does not work for high pixel clock such as 4MHz. My project requires the pixel clock to be at least 6MHz.

Has anybody done the similar DMA? I would like to know if the 3MHz is indeed the DMA data transfer rate limit? If so, will a 8bit -16bit/32bit UDB buffer can help the overall data transfer rate? How such a UDB buffer can be created.

Thank you!

 

Regarding USBUART

$
0
0

Hii I am using Psoc 5lp to get the data >> Amplify >> ADC >> DMA>> Filter >> USBUART.

Actually when I implemented ADC and USBUART it works fine I could able to send the data through USBUSART. But when I add DMA and Filter I could not detect the com port.

Can anyone please help me regarding this.

Thank you.

Hem k  

SuiteUSB: high data rate

$
0
0

Hello,

 

I want to dig into the USB interface. The goal is to have a high data rate interface with easy host driver implementation.

I'm not sure if I should use HID class or 'generic' interrupt endpoint implementation.

 

For the HID class:

If I understand HID class correctly, the specification only allows one IN and one optional OUT endpoint. Is this correct?

So the speed is limited to 64kB per HID. Now, I'm struggling with IAD (interface association descriptor). The IAD allows to collect endpoints into a single device. Is this also allowed for HID class ? So I could e.g. have a single HID with 4/4 IN/OUT endpoints on a PSoC 5LP? The benefit is that HID is supported on all main OS.

 

For the 'generic' interrupt endpoints:

If the above is not allowed by HID class, is it possible to use 4/4 interrupt IN/OUT endpoints without writing a custom host driver? From the SuiteUSB documentation, I couldn't get the information if this is supported. I assume that only a correct INF file is neccessary, is this true? If so, is there something like a INF file generator or at least a good manual how to do it?

 

Regards,

 

Ralf

failed updating firmware for kit-059


SPIS RX buffer data incorrect

$
0
0

Could someone provide a sanity check for me. I have an SPI slave module with an 8 bit word, 8 byte RX buffer, and an interrupt that triggers when the buffer is not empty. The interrupt toggles a flag which then executes :

if(SPIS_GetRxBufferSize() >7){         //wait until all 8 bytes of data have arrived
         x.b[0] = SPIS_ReadRxData() ;   //increment through the buffer
         x.b[1] = SPIS_ReadRxData() ;
         x.b[2] = SPIS_ReadRxData() ;
         x.b[3] = SPIS_ReadRxData() ;
         y.b[0] = SPIS_ReadRxData() ; 
         y.b[1] = SPIS_ReadRxData() ;
         y.b[2] = SPIS_ReadRxData() ;
         y.b[3] = SPIS_ReadRxData() ;
        
        SPIS_ClearRxBuffer();     //clear the buffer for the next set of data
        SPIS_ReadRxStatus();
 
   }

The issue I have today is that when I repeatedly send 0x0a and 0x0b (to test) the first byte is correct but then the rest are '05' (hexadecimal printout) (and for the next buffer all are 05). If I repeatedly send just one byte (0x0a for example) all bytes in the buffer are '0A' .This makes no sense to me. Is the code above correct? 

Thanks,

Evan

 

 

 

C library PSoC3 to PSoC5

$
0
0

Hi,

I have recently switched from Creator 3.0 - PSoC3 to Creator 3.3 SP2 - PSoC5. Have been having issues getting the libraries to function as they did previously in 3.0. I have checked the migration guide and there is no mention of the C libraries. First I had a problem with math.h and found an app-note on that regarding the build settings->linker->general. Is there a similar thing you have to do for stdio.h? The sprintf function doesn't do anything. Also, is there a guide for setting all this up?

Thanks,

Nick

USBUART Parity

$
0
0

Hi everyone,

 I have implemented a USBUART on my CY8CKIT-059 Kit everything works properly but I would change the parity and the stop bit of trasmission

Could someone tell me where I can set the UART's parameters?

Thanks

 

FREE RTOS in CY8CKIT-059 I need urgent Help

$
0
0

HI,

i  am following this website

https://www.element14.com/community/groups/microcontroller/blog/2016/07/...

here i am trying to add a new rtos task and want to give delay but in that  project    i am unable to modify delay.

since i am new to  psoc can you tell me how to set pin for GPIO and set delay by using programming not by  vydwr file where you just change pin button by GUI. That i do not want. I want the layer where pin no and delay can change.

Thank you

so please help me out

10 bits DAC Resolutions (PIDAC)

ADC, USBUART

$
0
0

Hii everyone,

I am new to Psoc I am taking analog signal and giving to ADC and then to Filter through DMA and then passing to PC through USBUART.

My concern is when I use less sampling rate in ADC and transfer the signal through USBUART I could plot in MATLAB in realtime and changes are also reflecting simultaneously. But when I use high sampling rate in ADC and when I transfer through USBUART I could able to plot but there is lot of delay. If I change the input It is reflecting after long time.

I am using 8bit ADC and I am transferring though USBUART by using USBUART_PutData(&Output,1); and in matlab I am reading one byte at a time and plottitng the graph.​

Please help me regarding this.

Thank you

Hem k

ADC DMA FIlter

$
0
0

Hii,

I am using 16 bit ADC and Transferring my data to Filter using DMA and Getting the result of filter in 16 bit. My concern is when I run the code it is not going into the loop. The code is exiting at while (Filter_IsInterruptChannelA() == 0) ; I attached the code please help me regarding this. My aim is to transfer 16bit output of ADC to Filter using DMA and get the 16 bit filter output.

Thank you

Hem k


I need Help !!!! How to Create a Map File in Psoc Creator 3.3 !!!!!

$
0
0

How to make Map file in Psoc 3.3 creator like visual studio or other IDE do. I need to make make file of my project that can communicate with some other CAN related hardware. i am using CY8KIT-059 microcontoller.

Thanks and waiting for reply

I2C VCNL 4010 Sensor

Madgwick IMU Filter: Define the Sample Rate / Freq. correctly

$
0
0

Hello,

can someone explain me if Is it possible that the GyroRate and AccelerometerRate are larger than the updateIMU-Rate (i do not mean the readSensorData-Rate, this is equal to the updateIMU-Rate) or does the algorithm / code than not work?

Thank you.

 

 

General Implementation of the "Madgwick Open Source IMU algorithm" (http://x-io.co.uk/open-source-imu-and-ahrs-algorithms/)

Pseudocode:

1. Init IMU-Hardware () 

- IMU Factory Reset

- Set IMU-ACC/GYRO "LOW-PASS-FILTER" 

- Set IMU-ACC/GYRO "Scale Range"

- Set IMU-ACC/GYRO "Sample Rate"

- Activate IMU-FIFO Buffer

- Set/calibate IMU-ACC/GYRO "OffSet "

 

2. While () //Limited to Madgwick() Sample Rate

- get IMU Raw Data

- calculate ACC-G-Values and GYRO-Rad/s-Values

- MadgwickAHRSupdateIMU

- calculate Angle

 

Note: 

-It is not strictly necessary for Accelerometer and Magnetometer measurements to be synchronised with Gyroscope measurements

-You can find on Github (https://github.com/xioTechnologies/Fusion) the new "xioTechnologies-AHRS-Lib" from 8.10.2016.

 

PSoC can no longer find target MiniProg

$
0
0

Hi, 

 

I am unable to program my PSoC 5LP on my CY8CKIT-001 development kit. When I set the Vdd switch to 3V, D1 is on but when I set it to 5V D1 starts flashing. I used a multimeter to check the voltage values and Vin is 12 V, 5V pin is 0, and Vdd is 0 and 3.3V pin is 0.3V. I'm not sure what happened? Any suggestions?

 

Ida

Serial Emulation Driver for USB

$
0
0

Hi ,

      We are using CY8kit - 059 , in that we require serial emulation driver for USB . Could you please give some suggestion how to we get the Serial Emulation Driver for USB.

Viewing all 387 articles
Browse latest View live


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