PSoC™ 5, 3 & 1 Forum Discussions
Hello,
Is it possible to block (with timeout) till I get specified N bytes ?
Or must I poll this channel till I get all data I need ?
Thank you,
Zvika
Show LessI originally asked this question to the Cypress Sales team via email, and they informed me that the question was technical in nature and therefore that I should post to the community forum.
Therefore, we're using the CY8CKIT-059, but I only need the kitprog that comes with the kit due to size and weight constraints. I am interested in purchasing the kitprog independently so that I don't need to tear off the actual PSOC and throw it away. Does anyone know of a distributor or 3rd party manufacturer who supplies such a module? I haven't found any on the distributor's websites nor through some google-fu.
Any suggestions are much appreciated.
Show LessHi all!
I'm having some bother with the DMA and understanding a few concepts. I've spent most of the weekend on this and can not get it working so turning to the trusted sages on here.
Basically I want to read in some 16bit values to , do something with them and pass them out again. So far I only have the Tx working with some sine wave test data but it would make my week if I could just pass Rx to Tx! I have the I2S block and DMA_1_ is connected to the Tx_DMA and DMA_2 to the Rx_DMA.
Thanks in advanced, code below.
Show Less
#include "project.h"
void DmaTxConfiguration(void);
void DmaRxConfiguration(void);
#define DMA_1_BYTES_PER_BURST 1
#define DMA_1_REQUEST_PER_BURST 1
#define DMA_1_SRC_BASE (CYDEV_SRAM_BASE)
#define DMA_1_DST_BASE (CYDEV_PERIPH_BASE)
/* DMA Configuration for RxDMA */
#define DMA_2_BYTES_PER_BURST (1)
#define DMA_2_REQUEST_PER_BURST (1)
#define DMA_2_SRC_BASE (CYDEV_PERIPH_BASE)
#define DMA_2_DST_BASE (CYDEV_SRAM_BASE)
#define LEN 101
int16_t inData[LEN];
int16_t outData[LEN];
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
Clock_1_Start();
I2S_1_Start();
I2C_1_Start();
isr_1_Start();
ADC_DelSig_1_Start();
codecConfig();
ADC_DelSig_1_StartConvert();
DmaTxConfiguration();
DmaRxConfiguration();
I2S_1_EnableRx();
while(0u != (I2S_1_ReadTxStatus() & I2S_1_TX_FIFO_0_NOT_FULL))
{/*wait*/}
I2S_1_EnableTx(); /* Enable Tx direction */
for(;;);
}
void DmaTxConfiguration(void)
{
uint8 TxDMA_Chan;
uint8 TxDMA_TD[1u];
TxDMA_Chan = DMA_1_DmaInitialize(DMA_1_BYTES_PER_BURST, DMA_1_REQUEST_PER_BURST, HI16(DMA_1_SRC_BASE), HI16(DMA_1_DST_BASE));
TxDMA_TD[0u] = CyDmaTdAllocate();
CyDmaTdSetConfiguration(TxDMA_TD[0u],LEN, TxDMA_TD[0u], CY_DMA_TD_INC_SRC_ADR);
CyDmaTdSetAddress(TxDMA_TD[0u], LO16((uint32)inData), LO16((uint32)I2S_1_TX_CH0_F0_PTR));
CyDmaChSetInitialTd(TxDMA_Chan, TxDMA_TD[0u]);
CyDmaChEnable(TxDMA_Chan, 1u);
}
void DmaRxConfiguration(void)
{
uint8 RxDMA_Chan;
uint8 RxDMA_TD[1u];
RxDMA_Chan = DMA_2_DmaInitialize(DMA_2_BYTES_PER_BURST, DMA_2_REQUEST_PER_BURST, HI16(DMA_2_SRC_BASE), HI16(DMA_2_DST_BASE));
RxDMA_TD[0u] = CyDmaTdAllocate();
CyDmaTdSetConfiguration(RxDMA_TD[0u],LEN, RxDMA_TD[0u], CY_DMA_TD_INC_DST_ADR);
CyDmaTdSetAddress(RxDMA_TD[0u], LO16((uint32)I2S_1_RX_CH0_F0_PTR), LO16((uint32)outData));
CyDmaChSetInitialTd(RxDMA_Chan, RxDMA_TD[0u]);
CyDmaChEnable(RxDMA_Chan, 1u);
}
I am currently trying to write to a few registers of my NHD-4.3-480272FT-CTXL-T display. When I am debugging, on my CY8C5888LTI-LP097, my return value for my read register functions are always returning zero. I was reading the SPI Getting Started datasheet, and it said that in order to read from a register, you must first send it a dummy byte to it can show up in the Rx buffer where I can then read it. However, this is not happening and I am always getting 0x00 back.
These are my functions to read:
unsigned char ft81xMemRead8(unsigned long ftAddress)
{
unsigned char ftData8 = 0x00;
ss_Write(0); // Set CS# low
SPIM_ClearRxBuffer();
SPIM_ClearTxBuffer();
SPIM_WriteTxData((char)(ftAddress >> 16) | MEM_READ); // Send Memory Write plus high address byte MEM_READ (command that reads)
SPIM_WriteTxData((char)(ftAddress >> 8)); // Send middle address byte
SPIM_WriteTxData((char)(ftAddress)); // Send low address byte
SPIM_WriteTxData(0x00);// Send dummy byte according to datasheet of display
SPIM_WriteTxData(0x00);// send dummy byte to get next Rx Byte.
ftData8 = SPIM_ReadRxData(); // Read data byte
ss_Write(1); // Set CS# high
return ftData8; // Return byte read
}
unsigned int ft81xMemRead16(unsigned long ftAddress)
{
unsigned long ftData16 = 0x00;
ss_Write(0); // Set CS# low
SPIM_ClearRxBuffer();
SPIM_ClearTxBuffer();
SPIM_WriteTxData((char)(ftAddress >> 16) | MEM_READ); // Send Memory Write plus high address byte
SPIM_WriteTxData((char)(ftAddress >> 8)); // Send middle address byte
SPIM_WriteTxData((char)(ftAddress)); // Send low address byte
SPIM_WriteTxData(0x00); // Send dummy byte display datsheet
SPIM_WriteTxData(0x00);// to get Rx Buffer. I have tried debugging with and without this line.
ftData16 = (SPIM_ReadRxData()); // Read low byte
SPIM_WriteTxData(0x00); //added this*******************
ftData16 = ftData16 | (SPIM_ReadRxData() << 8); // Read high byte
ss_Write(1); // Set CS#hHigh
return ftData16; // Return integer read
}
Message was edited by: Monica Olvera
Show LessHello,
I have some problem of sending or receiving data for rs232 port in Psoc 5lp development kit.
Have some solution regards this?
connection of this I am using re232 to usb cable. and also detected the port in my pc. But I can't communicate with serial terminal.
Which example I preferred for this?
I am using UART_Rx programme for that but I could not receive any data.
Show LessI want to use PSOC5LP-059 to capture a signal from a pressure sensor and display it with a four-digit 7-segment led, but I don't know how to use the AD converter. As for the specification, I want to be 0Mega Pascal with 0.8V input. Should the ad Converter select a 16-bit AD? If the sensitivity is too large, the display will not be fixed. The minimum value is 0.00 Mpascal. Please advice.
Show LessHello. I wanted to be able to adjust the frequency of the WaveDAC8 with a resolution of 1Hz best case scenario via software while running. I know there are a lot of parameters like WaveDAC resolution, max waveform bandwidth etc, that can vary results, but for now I am happy with just approval of the following method in general.
Attached is a picture to adjust the frequency using a timer. It compiles and seems good so far. Is this a good method to achieve basic adjustment of the WaveDAC via software while running or is there a better method?
Show Less
As mentioned in datasheet, the CSP package has different boost converter component requirements and I'm asked to contact Cypress support on how to use it.
Is there any guidelines on how to use the boost converter with CSP packaged PSoC5LP? The particular part I'm interested in is CY8C5888FNI-LP214.
The goal is to generate 5V from 2.5V input to drive a MOSFET gate driver (1nC charge*4ch, 4MHz --> 16mA).
Thanks,
Bo Gao
Show LessCurrently I am taking 16 bit waveform data stored in an array, splitting it into two 8 bit bytes, and sending to two control registers. This works great, but I want the DMA to do this so I do not have to run the waveform in a forever loop. See the current wave generating code below.
while(1)
{
Wave_Data_MSB_Write(MSBData);
Wave_Data_LSB_Write(LSBData);
CyDelayCycles(var_delay);
i++;
}
Could someone guide me to do this with the DMA? I attached a picture of the control register set up... I placed DMAs as I think they would be used. I added Status regs but I do not think I even need them. I just want the data to stream over to the control registers. I will adjust the speed with the clocks after it is working...
I do not know what to do here...
Show Less
Hello,
I'm using PSoC 5LP I2C Master device. I have to read and write from a slave device which has sub-addresses. I'm able to write to the device, now I want to read back what I wrote to verify that the writes are done. My example code for write is given below. How would I do something similar for read.
Thanks.
uint8 temp = 0;
i2c_slv_addrs = slave_address >> 1; // I2C slave address, shift right by 1 bit, 7 bits addressing
slave_sub_reg[0] = sub_address; // sub address
slave_sub_reg[1] = data_to_write; // data to write
do
{
temp = I2C_MasterWriteBuf(i2c_slv_addrs, (uint8 *)slave_sub_reg, 2 , I2C_MODE_COMPLETE_XFER);
}
while (temp != I2C_MSTR_NO_ERROR);
// stay here until full xfer is done
while(I2C_MasterStatus() & I2C_MSTAT_XFER_INP);
temp = HDMI_I2C_MasterClearStatus();
// If there is an error while transferring data
if(temp & HDMI_I2C_MSTAT_ERR_XFER)
{
// Indicate the error
}
Show Less