Hi All,
I am working with PSoC 4200 chip, i coud not find any example for UART reception in interrupt mode.
i did not want to poll for data // ch = UART_UartGetChar();
anyone have idea on this?
Thanks,
Ashok R
Hi All,
I am working with PSoC 4200 chip, i coud not find any example for UART reception in interrupt mode.
i did not want to poll for data // ch = UART_UartGetChar();
anyone have idea on this?
Thanks,
Ashok R
Hello,
i am trying to read an external Flash over SPI.
On oszilloscope looks data well, but my variable a and b is wrong.
Code:
SPIM_SpiUartWriteTxData(0x03); // Readcomand
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(A_high); // Adress
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(A_mid); // Adress
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(A_low); // Adress
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(0x00); // Dummy
a = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(0x00); // Dummy
b = SPIM_SpiUartReadRxData();
I use SS Pin automatic. And a read 16 bit value (2 times dummy 0x00 at mosi pin)
My problem is, a und b is wrong.
Somebody know, was can the problem be? Component "SPIM" has default settings. Master Mode, CPOL 0
Thanks
Best regards
Alex
We are working on a project, where we want to manage a Vishay VEML6040 I2C color sensor with a Cypress PSOC4 MCU. We had difficulties to process the results, what we got from the sensor, so I started to debug the issue. At first I tried to communicate the sensor with another master, using a logic pattern generator in bit-banging mode, and the sensor works perfectly.
Then I started to analyze the I2C transfers from Cypress side, and noticed some strange behavior of the MCU. It seem's the bytes from the sensor aren't in the correct order, and sometimes are corrupted, compared to my logic analyzator results.
I try to manage the sensor with the following C function (Data rate: 100kbps FIFO byte mode: 8bit, SW: PSOC Creator 3.3 + SP2, HW: CY8C4248LQI-BL583 on CY8CKIT-042-BLE-A)
uint32 ReadColorSensor (uint32 command) { uint32 result = 0; //data from color sensor uint32 resh = 0; //data high byte uint32 resl = 0; //data low byte uint32 slaveadd = 0x10; //address of RGB color sensor I2CM_I2CMasterSendStart(slaveadd , 1); //start transfer to address = 0x10 + WR I2CM_I2CMasterWriteByte(command); //send command byte (sensor internal address) I2CM_I2CMasterSendRestart(slaveadd, 0); //send restart to address = 0x10 + RD resl = I2CM_I2CMasterReadByte (1u); //read low byte resh = I2CM_I2CMasterReadByte (1u); //read low byte I2CM_I2CMasterSendStop(); //stop transfer result = (resh << 8) + resl; return result; }
At first we send the start bit, and the slave address, then set up the slave command register (this is the internal address, to select what color level read from the sensor), then send a repeated start with the address, and at last read the two bytes from the slave, then finish the transfer with the stop bit.
After deeper analysis of the I2C API, I've discovered, that the I2CM_I2CMasterSendRestart API function causes 8 extra clocks after sending the start bit, and the address byte, as you can see on the attached picture (the software is stopped after calling I2CM_I2CMasterSendRestart function). I suppose this extra clocks causes the confusion in the data bytes. I spent many hours with reading Cypress docs and debugging the API to unterstand better the working theory of the Serial Communication Block, but i wasn't able to discover how are the bus transfer triggered. I marked the attached logic analyzator pattern (i2c_transfer_logic_analysis.png), how are the byte transfer triggered by API instructions, and doesn't seems to me very consequent.
1. I2CM_I2CMasterSendStart(slaveadd , 1);
In this API function slave address is written into TX buffer (I2CM_TX_FIFO_WR_REG = slaveAddress;) then set the M_START_ON_IDLE bit in the I2C_M_CMD register (I2CM_I2C_MASTER_GENERATE_START;), which causes to generate the START bit, and writes the address data to the bus.
2. I2CM_I2CMasterWriteByte(command);
In this funtcion the writing of the TX buffer (I2CM_TX_FIFO_WR_REG = theByte;) starts the transfer, and causes to clock out the 9 SCL pulses.
3. I2CM_I2CMasterSendRestart(slaveadd, 0);
First set M_START bit in the I2C_M_CMD register (I2CM_I2C_MASTER_GENERATE_RESTART;) - nothing happens on the bus, then writes the address to the TX buffer (I2CM_TX_FIFO_WR_REG = slaveAddress;), this sends out the repeated start bit, writes the address byte, and after that clocks 9 extra pulses to the bus...
All in all, i have two questions.
1. I'd like to know, how to implement this two byte read with repeated start condition.
2. Are there any other documention, than PSoC 4 BLE Registers Technical Reference Manual and PSoC 4 BLE Architecture Technical Reference Manual, where i'm able to find more information to make our own API managing the SCB peripharial?
Thanks for your answer!
In the hardware design (PSoC Creator 3.3, PSoC 4 Prototyping Kit) I use some digital components with external inputs to decide how to set a digital output with hardware connection outside the PSoC. This works quite good. Now I want to read this output and use the value in the c-program to display additional stuff on the LCD-Display. But I have no luck in getting a value from the output-pin.
I start with defining a variable...
int CutOffVariable = 1
and later I'm polling the digital output "Cut_Off" with...
CutOffVariable = Cut_Off_Read();
but the variable doesn't change although I measure that the the hardware pin has changed it's status.
I tried also with ...
CutOffVariable = Cut_Off_ReadDataReg()
but I had no luck, probably don't understand the format of the returned value.
Any ideas how to solve this problem?
Cheers
Thomas
Hi all,
I am currently studying the USB Mouse Example.
I have understood the movement of the cursor, but I am not sure how to emit a button click.
Does anybody have an idea?
Regards
Julian
HI!
I'm working on a project that stores data from an IMU (MPU-9150) on a SD card. I'm using a PSoC 4 (CY8CKIT-049-4xxx). The connection between the IMU and PSoC is I2C and SPI between SD card and PSoC. To store data I have used the SDCard example as template:
https://www.element14.com/community/thread/25517/l/psoc-4-pioneer-kit-co...
My issue is that I am looking to store data at atleast 1KHz and at the moment it is logging at something closer to 40Hz!
I have a feeling that the filepointer process is taking too many resources..
I kindly ask for some feedback.
Hi everyone,
can anyone tell me which API functions to use in order to get the signal values of the elements of a slider as displayed in the TUNER GUI?
I have scanned through the API, but all I can do is read whether the widget is active or not?
But how can I extract the signal (not the position or centroid?) without changing the configuration or updating the baselines?
Regards Julian
Hi all,
I'm trying to make it possible to read the battery level from my device using SAR ADC, but unfortunately I can't manage to connect it properly. I've been searching some info on the Internet and I was trying to make it similar to the solutions I've found. I've attached a scheme of my connection. Could someone give me a hand how to make it right?
I am trying to port the library provided by Adafruit (https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library) to use it in my project.
This library is intended to be used with PCA9685 chip, which provides 16 pwm outputs by the use of the I2C protocol.
I already have a board from adafruit and tested with an arduino and their library, it works fine. I tried to do the same with psoc but I guess I don't ported it well because it is not working (nothing happens when I try to make a servo to work.
I attach you the project so you can check my code and give me some ideas. I am using the first address (6 different modules can be added. The first one is 0x60, it is wrong in my project but result is the same fixing it).
I have a major problem with a design in which I am trying to use the example EM_EEPROM component from the pioneer kit to store a few strings in flash on a Cy8ckit-049 platform. I ported the the quite simple EM_EEPROM example project from the pioneer over to the 049 and intergrated with the 049 bootloadable blinking led project.
The problem is if I don't REMARK OUT -->status = Em_EEPROM_1_Write(array,eepromArray,14u); , the app breaks.
Normally the 049 runs the BOOTLOADER at power-up. If the switch is not pressed within a short time, control passes to the other project (the main bootloadable app). The problem that occurs is as long as we leave the above listed WRITE active the 2nd boot-up causes the BOOTLOADER to always go active, ie flash and wait for bootloaderhost to start bootload sequence and we can never pass control to the main bootloadable app.
Ie, on first boot, the above EM_EEPROM write occurs and modifies flash string, but then on 2nd boot we stick in the bootloader from that time forward on all boots.
It's like some mechanism is noticing that the cksum has changed and then forces the control to somehow stay in the bootloader.
If you can imagine what is happening here I would greatly appreciated it.
I have also attached the creator 3.3 bundle with notes at the top of the main.c describing the recreated problem.
Hello,
can I use 3.3V power supply for board CY8CKIT-043 and debugging with integrated debugger over USB with 5V power supply?
Power supply from debugger to board is disconnect.Can I destroy the board?
Thank you
Hi All,
I am using SPI & UART in my project,
Initially i added UART(v2.50) into my project , works everything as expected.
Later i added SPI Master Fullduplex macro and getting this below error.
Pin guidance unavailable: Resource limit: Maximum number of Macrocells exceeded (max=32, needed=37).
If i add the originlal SPI Master (v2.50) aslo im getting same error
please provide me the solutions
Thanks,
Ashok R
Hello,
I am having an issue with using the UDB PWM component with 48 MHz HFCLK clocking. Since I was using the USB component, I must set the HFCLK to 48 MHz. When building the project, this warning message apperars:
Warning-1366: Setup time violation found in a path from clock ( clk1m ) to clock ( clkphase ).
And it indicates the max frequency being only 29.8 MHz.
Thanks for your help!
I have attached the project to this post.
I have an ISR component ISR_1 connected to the OV pin of a PWM block.
In the main file I have the following code:
CY_ISR_PROTO(MyISR);
CY_ISR(MyISR)
{
PWM_1_Stop();
}
int main()
{
PWM_1_Start();
ISR_1_StartEx(MyISR);
CyGlobalIntEnable;
}
PWM should stop as soon as the interrupt is executed. But it does not.
Please help
Hi Folks,
i have some trouble in getting the PSOC4 working as expected. My target is to read out the data of a Current and voltage sensor (max78630) and for that i am using I2C (SCB I2C Master). The software was working but i do not know what happend, but now my I2C communication seems to not work correct anymore. The crazy thing is that my software do't show any behaviour when i disconnect the I2C sensor, no error. Also what crazy is, the sensor address is 3, but when I scan, the sensor answers at address 15, that doesen't make sense to me, I really appriciate every hint :)
best regards,
Nils
Hi all,
I tried to download the cysmart mobile app, but i couldn't do it. So if any one having that apps please share to here. otherwise tell me how to download the apps by free of cost.
thanks in advance
My ADC is running at 12MHz, it samples 5 channels and the actual sampling rate is 100KHz.
I just noted that reading a single channel using the ADC_GetResult16() command takes a whooping 1us at 48MHz CPU speed.
It takes over 5us to read the 5 channels. Now at 100KHz sampling rate, time between two successive samples is 10us out of which 5us is wasted in simply reading the ADC. Only 5 remains for performing other calculations before the next sample arrives.
This is very very slow. In fact what sense does it make if the ADC runs at 1MSPS and takes another 1us to read the channel.
Is there a faster method to read the ADC channels?
Can't we directly read the channel resistors?
Thanks
Hi
So, I have run out of pins on the CYBLE-014008 module. I need another digital output pin.
Is it possible to change the function of an assigned pin (say a DAC output) at runtime? Or even use the SWDIO as a GPIO pin whilst retaining SWD?
Thanks.
Hi,
The SCB based SPI limits the data rate to 8Mbps. I would like the go as high as 24Mbps. Is it possible to do with PSoC4 devices? The HFCLK is 48 Mhz.
regards
I created a project with a bootloader and a bootloadable component. I've designed the bootloader to wait 2 second then run the application. The application will launch into a reset if a certain register gets written to. Giving a custom bootloader host a chance to write a new application.
My problem is on startup the bootloader never exits and waits for a command forever. Debugging it the application id being valid is failing and therefore its running the bootloader forever. Am I doing something wrong?