PSoC™ 5, 3 & 1 Forum Discussions
Hi All,
I want to measure a current ( the load is uknown (changes)) and a voltage, such that I can make a maximum Power point calculation. Is it possible to use a DAC, for the current and a ADC for the Voltage? If yes, how should I configured it.
Thanks.
Show LessHello,
I need help for adc reading of 16 channel.
In which what i need to use ADC mux? Here i attached the snap short and also which ADC i need to use for that? ADC seq or else? I am using PSOC 5lp, kit-050
Show Less
Hi,
i have configured the controller as I2C master and communicating with two slaves(RTC and EEPROM).
am not able to read the data from EEPROM (I have written data to the 0x0002 address).
please let me know about I2C configuration and Read and write function use.
int main()
{
CyGlobalIntEnable; /* Enable global interrupts. */
I2CMasterIntilization();
g_ucEEPROMWriteBuffer[0] = 0x00;
g_ucEEPROMWriteBuffer[1] = 0x02;
g_ucEEPROMWriteBuffer[2] = 0x05;
g_ucEEPROMWriteBuffer[3] = 0x45;
while(1)
{
WriteDataToEEPROM(3);
g_ucEEPROMWriteBuffer[0] = 0x00;
g_ucEEPROMWriteBuffer[1] = 0x02;
ReadDataFromEEPROM(2);
}
}
void I2CMasterIntilization(void)
{
I2C_Master_Start();
}
void WriteDataToEEPROM(char chDataByte)
{
I2C_Master_I2CMasterWriteBuf(EEPROM_SLAVE_ADDRESS,(unsigned char*)g_ucEEPROMWriteBuffer,chDataByte,I2C_Master_I2C_MODE_COMPLETE_XFER);
while((I2C_Master_I2CMasterStatus() & I2C_Master_I2C_MSTAT_WR_CMPLT) == LOW)
{
}
CyDelay(3);
}
void ReadDataFromEEPROM(char unNoOfDataByteNeedToReceive)
{
I2C_Master_I2CMasterWriteBuf (EEPROM_SLAVE_ADDRESS,(unsigned char *)g_ucEEPROMWriteBuffer,2,I2C_Master_I2C_MODE_COMPLETE_XFER);
//CyDelay(1000);
while((I2C_Master_I2CMasterStatus() & I2C_Master_I2C_MSTAT_WR_CMPLT) == LOW)
{
}
I2C_Master_I2CMasterReadBuf(EEPROM_SLAVE_ADDRESS,(unsigned char *)g_ucEEPROMReadBuffer,unNoOfDataByteNeedToReceive,I2C_Master_I2C_MODE_REPEAT_START);
while((I2C_Master_I2CMasterStatus() & I2C_Master_I2C_MSTAT_RD_CMPLT) == LOW)
{
}
}
if I use I2C_Master_I2C_MODE_NO_STOP while writing data from master , then clock will become low after transmitting data (SCL line is low). I used I2C_Master_I2C_MODE_COMPLETE_XFER to write the data , then wring is working fine and SCL and SDC lines are high after writing data to EEPROM.
kindly let me know about API's which I used in my coding.
please find the attached I2C module setting image.
Regards,
Ambarish BH
Show LessHello,
I'm trying to use the DMA tor create output pattern, which has three phases: On, pattern, off with different length, but the same time resolution (1MHz)
I'm running the system at 64MHz.
The DMA is triggered by an internal Clock of 1 MHz.
The first phase runs nicely, As soon as the DMA switches to the next TD, the DMA now runs full speed, ignoring the hardware trigger signal.
Unfortunately, I can't see the reason why.
Any help appreciated!
Thanks
Bodo
Show Less
Hi, I am trying to reset an I2C Master after inserting random glitches to the hardware I2C. I have not been successful on resetting the hardware. It seems that once I2C Master is hanged due to random glitches, it stop responding even though the hardware is reinitialized. I am testing this with no slaved attached, so all transaction are NAKed.
I2C_Stop();
I2C_MCSR_REG = 0;
I2C_Init();
I2C_Enable();
I2C_EnableInt();
I2C_MasterClearReadBuf();
I2C_MasterClearWriteBuf();
I2C_MasterClearStatus();
Even after those routines are called, the I2C_MCSR_BUS_BUSY bit in I2C_MCSR_REG remains '1'. Can anyone help with resetting the I2C hardware?
Show LessHello, I'm stuck in trying to get a simple example working that include an I2C Master and I2C Slave. I trying to use the high-level API's to do a MasterReadBuff function call.
void InitializeSystem(void) | // Start all components, initialize variables, perform self-test |
{
uint8 ii; |
CyGlobalIntEnable;
for(ii = 0; ii < BUFFSIZE; ii++)
{
SlaveSendBuffer[ii] = ii; |
}
PWM_Start();
Slave_I2C_SlaveInitReadBuf(SlaveSendBuffer, BUFFSIZE);
Slave_I2C_SlaveInitWriteBuf(SlaveReceiveBuffer,BUFFSIZE);
Slave_I2C_Start(); | // Initialize I2C slave |
Master_I2C_Start();
PWM_WriteCompare(1); |
}
int main()
{
int i,k; | |
uint32 MStatus; | |
uint8 temp =0; | |
uint8 mydata = 1; | |
uint8 write_data_buffer[SUB_ADDR_LENGTH] = {SUB_ADDR_LOCATION}; |
InitializeSystem();
MStatus = Master_I2C_MasterSendStart(SlaveAddr,Master_I2C_WRITE_XFER_MODE); | // Initialize a transaction for writing | ||
Master_I2C_MasterClearStatus(); | |||
Master_I2C_MasterReadBuf(SlaveAddr, Master_Rd_Buffer, READ_DATA_LENGTH, | Master_I2C_MODE_REPEAT_START); | ||
while(0u == (Master_I2C_MSTAT_ERR_XFER & Master_I2C_MSTAT_RD_CMPLT)) | |||
temp++; |
}
I'm having trouble reading from the SlaveReceive Buffer. Can anyone give me some help?
Thanks,
Joe
Show Lesshello,
Is power monitor with sar adc available for psoc5?
Hi,
I've a PSoC 5LP with two virtual COM ports (EP1 through EP6) and two interrupt endpoints, configured as a IN/OUT pair with 64 bytes packet size and 1ms. Those two endpoints are also accompanied by an interface association descriptor (see attachment) to be able to bind the CyUSB3.sys driver to this interface (this is my understanding of how to use the IADs when the device provides more than one function and/or endpoints for different tasks).
The VCPs are working, but I can't access the interrupt endpoints. The current test setup is as follows:
I'm using the 'USB control center' application, which is part of the FX3 SDK. The two interrupt endpoints of the device are correctly detected. I select the detected interrupt out endpoint of the device, and send some text to the device, but I'm getting 'error 997'.
The device firmware is merged from the USBFS_UART example source code and the AN56377 'PSoC 3 and PSoC 5LP USB Transfer Types' application note example #1. Using the original AN56377 source code, the device works well, so it's not a faulty hardware. Now, how can I figure out on which side of the USB cable the error is? It's either my driver INF file and the binding to the CyUSB3.sys driver (I doubt because the device manager doesn't show errors, the VCPs are working and the device and the two endpoints are correctly detected by the USB control center application) or my device firmware - but it's simply extended the USBFS_UART example source code by the interrupt endpoint part of the AN56377 example #1 code. So, in fact the main function pseudo code is as follows:
void main(void) {
//device initialization (same a USBFS_UART code)
...
//main loop
for(;;) {
//check for USB configuration change from host
{...}
//service USB CDC, extended for two VCPs
{...}
//code snippet from AN56377 for interrupt IN/OUT handling
if(USBFS_1_GetEPState(8) == USBFS_1_OUT_BUFFER_FULL) {
countI = USBFS_1_GetEPCount(8);
USBFS_1_ReadOutEP(8, bufferIrx, countI);
USBFS_1_LoadInEP(7, bufferIrx, countI);
USBFS_1_EnableOutEP(8);
}
}
}
The main difference from AN56377 is that in my implementation there's only one alternate setting 0, which directly has the two interrupt endpoints assigned. From my understanding, AN56377 needs alternate setting 0 with no endpoints because of the supported bulk interface. That's why I assigned the two endpoints directly to alternate setting 0.
So, anyone can help me figuring out what's going wrong?
Regards
Show Less