PSoC™ 5, 3 & 1 Forum Discussions
Hello everyone !
I’m new with PSoC and I would like to generate a sin wave from the VDAC.
To do so I need a ( high ) number of values for the argument of the sine function.
I tried to create a list like in python : theta = [0:(2*pi//100:2*pi] for example, but every time I try something it is invalid.
I also tried to mane a for loop outside the main function like this :
unsigned int step:
for ( step=0; step<100; step++)
{
}
it didn’t work as well. I had expectation of ‘(‘
Also, let’s imagine I have a set of values for the angle of my sine function, let us call it x.
Can I do sin(x) to have another set of value of the sin of each value for the angle ?
thank you for your help
Show LessHey all
I created an I2C Mux component for the PSoC 5LP To read data from 3 IMUs with the same address. I basically wrapped a channel selection function over I2C functions:
void I2C_Mux_SetChannel (uint8_t channel) {
switch (channel){
case 0:
CS1_Write(0);
CS0_Write(0);
CyDelayUs(500);
break;
case 1:
CS1_Write(0);
CS0_Write(1);
CyDelayUs(500);
break;
case 2:
CS1_Write(1);
CS0_Write(0);
CyDelay(500);
//prev_channel = 2;
break;
case 3:
CS1_Write(1);
CS0_Write(1);
CyDelayUs(500);
break;
default:
//CS1_Write(0);
//CS0_Write(0);
break;
}
}
#define SET_CHANNEL(channel, func, ...) (I2C_Mux_SetChannel(channel), func(__VA_ARGS__))
This kind of works, but I'm having 2 issues:
- The MasterReadBuf function seems to be behaving differently when I use it - when I use blocking functions to read my IMU data I get values that make sense, when I use non blocking functions I seem to be reading 0 for gravity (even though I get no error on reading and I seem to be reading the correct data 16 Bytes);
- I have an issue starting the different IMUs sequentially. I can get each of the IMUs to work individually, but when I try to get them to run sequentially the number of bytes to be read for the second IMU seems to grow exponentially.
Do you guys have any ideas of what could be causing these issues?
Please find attached a workspace bundle (although it might not be easy to work with since it has FreeRTOS stuff on there), and an image that shows my I2C was trying to read 3000 bytes. The relevant files for this issue are main.c and I2C_Muxing.c
Thanks
Amilcar
Show LessI want a current source to test one of my trans-impedance amplifiers.
My requirement is to generate a dc current source whose value varies between 0.1 nA to 1 nA, if possible up to 1.5 nA.
I hope I can do it with the IDAC8 module and few resistors with the current division principle.
Though I have a few questions regarding this.
1. I'm not able to generate 0.125 uA with software mode (through a program), even though I can do it in hardware mode. Since the IDAC_SetValue function supports only unsigned integers. Is there any way to generate 0.125 uA current with software. After all, I'll control the current source with the help of a LabView program or through a Windows hyper terminal application.
2. I generated a=1 uA current flowing out of the port pin P 0(6) with the IDAC module. I connected a 100 kohm resistor between the pin P 0(6) and PSoC ground and measured the voltage between the 100 kohm resistor. I sourced 1 uA and measured the voltage and seems to be ok with the calculated value. But, when the measured value is supposed to be more than 3.3 V (PSoC in 3.3V mode), I repeatedly measure the voltage to be only 3.3 V as maximum value even the supposed measured value to be more than 5 V or so. Why is it so?
Kindly suggest answers.
Regards
Arivalagan
India
Show LessHi,
I've run the USBUART example with all the defaults for the CY8CKIT-030A kit and am having it send 256KB as fast as possible by looping transfer of 64 byte packets x 4096 times.
The issue is that USBUART seems to be pretty slow, it's doing about 160KB/s which is about 1.3Mbit transfer. Is this normal? I was hoping to achieve maybe 3Mbit or more.
Thanks!
Edit: I changed from Debug to Release compiling and that has sped it up a little bit more, 256KB/s. Is there anything else to make it faster?
Show LessRegarding the trans-impedance (TIA) amplifier in the CY8Ckit-001, I've got the following questions.
1. I use the code example of the TIA where the input current is taken from the IDAC8 module and the VDAC module is used as a 1.6V voltage reference.
Why does one need a voltage reference? If I try to make the Vref to 0V, then the total TIA output goes to 0V. Why?
2. How do I characterize or measure the frequency response of the TIA inside the PSoC5LP? How do we measure the frequency response of the TIA in general?
Kindly clarify
Arivalagan
India
Show LessHi all,
I have some questions about USB functionality on a PSoC5LP. The project I'm working on requires multiple USB devices on a single USB connection. Namely, both a USB HID (keypad) and a USB UART. I have gotten both of these components working separately (I.E. in different projects) but I can't seem to figure out how to run both these devices at the same time on the same USBFS component. For the USB UART, I used the descriptor template USBUART_TwoComPorts.root.xml (came with PSoC Creator) and deleted the second COM port from the descriptor (CDC Interface 3 and 4), as I only need one of the COM ports. This works on its own, and I can take data in and echo it back to the virtual COM port as seen from my PC. However I can't seem to get it working in conjunction with a USB HID in the same component.
I imagine there are rules to running multiple devices on this single USBFS component, I'm just not aware of them.
I'm currently starting USB up as follows:
uint8 Keyboard_Data[8] = {0,0,0,0,0,0,0,0};
USBFS_1_Start(0,USBFS_1_DWR_VDDD_OPERATION); //Start up the USB HID Keypad
USBFS_1_EnableOutEP(2);
USBFS_1_Start(1,USBFS_1_DWR_VDDD_OPERATION); //Start up the USB UART
while(!USBFS_1_bGetConfiguration());
USBFS_1_LoadInEP(1, Keyboard_Data, 8);
USBFS_1_CDC_Init();
I then call the following periodically to send keyboard data:
if(USBFS_1_bGetEPAckState(1)) {
USBFS_1_LoadInEP(1, Keyboard_Data, 8);
while(!USBFS_1_bGetEPAckState(1));
}
I also call a periodic function to take in CDC data and echo it back:
if (USBFS_1_DataIsReady()){
count = USBFS_1_GetAll(USB_Buffer); /*MAX 64 BYTES PER SPEC*/
if (count != 0){
/*We have data*/
/*Wait until ready to send data*/
while (!USBFS_1_CDCIsReady());
/*Echo it back*/
USBFS_1_PutData(USB_Buffer,count);
/*If we are at max buffer size, append a NULL to assure PC identifies end of data*/
if (count == MAX_USBUART_BUFFSIZE){
while (!USBFS_1_CDCIsReady());
USBFS_1_PutData(NULL,0);
}
}
}
Where I run into problems is when I attempt to add a USB UART.
My question is, in what way should I be configuring/starting the devices up as to have the USB UART function at the same time as the HID Keypad? What considerations do I need to have in mind so that the devices play nice with each other? I'm very new to using PSoC and USB so it's possible it's something very obvious that I'm just not familiar with.
Any advice would be greatly appreciated.
Thanks!
Show LessAre there any appnotes or example projects supporting an external ADC, parallel interface via DMA? I can't seem to find anything. I see a parallel-to-serial example in the AN84810 which is helpful, but was hoping for a bit more specific.
Thanks for any tips -Steve
Show LessHello,
I have implemented correctly a PRS_17 using firmware routine in PSoC5 LP.
My system is properly working with the following step:
* I read a 17 bit pseudo sequence (as a bar code) and I decode it with a 17 bit polynomial;
* I set in the firmware the start seed using PRS_17_Seed(1);
* With a for cycle (start from 0 to 131072), I run the PRS_17_Read() function + PRS_17_Step();
* When my decode number match the PRS_17_Read() number, I break the for cycle;
* The cycle counter is my displacement of the absolute code.
The above system i s properly working.
My problem is that the "for cycle" can takes up to 2^17 iterations to terminate and in my case it means about 150ms.
I want to reduce this time, so I was thinking to replace firmware routine with hardware implementation.
First, I annotated the initial sequence returned from the PRS_17_Read() function, start with seed = 1 (see attached routine).
Second, I turned PRS_17 component as "clocked". On each clock the PRS_17 increment by 1 (as PRS_17_Step() function).
The problem is that the output stream is not the same of the annotate sequence and I can't understand why.
I attached a simplified project.
Regards,
Show LessIn an answer to one of the latest questions in the PSoC5 community, I found the statement above. Is there more information around that?
There are for sure applications, that can not be done with PSoC4 nor with PSoC6. I am using much of the vast amount of building blocks of the 58 and still wish to have more. None of the other PSoCs is suitable. I would have to use two or three PSoCs to do the same, but without the flexibility and the ease of use.
Are there other users with similar thoughts?
And how does the roadmap for PSoC5 look like?
Thank you!
Show Less