PSoC™ 5, 3 & 1 Forum Discussions
I can connect a vref or a vdac output to an analog mux. However, it appears that I can only connect a gpio pin to an ADC_SAR_Seg component. The device is a 5lp.
Am I doing something wrong or is this a limitation of the ADC_SAR_Seg component?
Thanks
Glenn Edgar
Show LessIn ADC_SAR.c, why dose ADC_SAR_IsEndConversion() call CyDelayUs(1u) ?
I don't understand the meanig of comment /* wait one ADC clock to let the EOC status bit release */.
And, I can't find the detail of EOC status bit.
Show LessI'm having an issue with the checksum not working for the first packet in making a custom UART,per the Psoc 3, Psoc 4, Psoc 5LP and Psoc Analog Coprocessor UART Bootloader page 33-35 http://www.cypress.com/file/45171/download . This packet only contains start, the enter bootload command,the checksum for those two commands and the end command.The checksum should be the two's complement of the LSB and MSB for the addition of 0x38 and 0x01 which is 0x39 but for some reason the psoc is responding with incorrect checksum or 0x08. The current values that I am using are 0x07 for the LSB and 0x0C for the MSB. If anyone has an idea on what the issue may be please reply.
-Thanks
Show LessI was hoping that I could use mass storage programming mode with the KitProg on a CY8CKIT-059 board to program the target PSoC 5. I'm using the board as the low-level controller inside a prototype robot, and re-programming it requires some inconvenient disassembly. The next revision of the prototype also has a Raspberry Pi connected to the outside world with either WiFi or wired Ethernet.
The initial announcement of mass storage programming mode suggested it would be cross-platform (After I've tried and failed, I see in other materials that it probably isn't supported on Linux). I thought maybe I could plug the CY8CKIT-059 into the Raspberry Pi, copy the new .hex files over the network, to a holding folder on the Pi, and then copy them to the KitProg "drive" to update the robot firmware.
I tried it and it doesn't work.
Directly after mounting the KitProg (v2.18) mass storage device:
After copying the .hex file to the KitProg mounted drive:
However, I get the same error and failed programming with drag-and-drop in mass storage mode on Windows, and clearly the note states that mass storage mode only works with PSoC 4.
So I'd be interested in knowing:
- Is there any update or timeline for adding PSoC 5 support to KitProg mass storage mode so that it can be used on the CY8CKIT-059?
- Is this definitely the problem here? (i.e. should it be impossible to use mass storage mode with a CY8CKIT-059 on Windows as well?)
- Given that the failure on Linux appears to be identical to the failure on Windows, will mass storage mode work for loading firmware to the device from Linux if PSoC5 support is added?
Thanks,
Dan
Show Lesswe are repairing equipments that are using the CY8C5668AXI as a power sequencer, i would like to know which programmer kit i can use to interface with this controller in order to debug the power supplies.
Thanks for your help
Show LessHi all,
I'm working on a system that has multiple analog inputs that need to be handled at different rates, and I'd like a little feedback on what might be the best way to go about it.
I have 2 Analog inputs. The first of which is a control voltage I need to average out and process quickly and constantly for an LED backlight. The other is a thermal sensor which only needs to be updated every couple seconds.
The solution I came up with for this is an Analog Mux component with the 2 inputs going in and the output running to the input of the SAR ADC component. I have the SAR ADC configured for 12 bits, free running, internal clock. I have an ISR tied to EOC to process the incoming readings. I am taking constant readings on input 0 of the mux, and every 2 seconds I switch to another input, take a single reading, then return to input 0.
The first (0) input of the mux is where it's spending the most time. My concern is how to handle the switch to other inputs for a single read every 2 seconds or so. Right now I am switching as shown:
void Svc_Ana_Mux(void){
/*Called repeatedly from main()*/
if (Get_Temps){
/*Every 2S*/
ADC_EOC_Stop();
ADC_SAR_StopConvert();
while (!ADC_SAR_IsEndConversion(ADC_SAR_RETURN_STATUS));
ADC_SAR_GetResult16(); //Clear last conversion
ADMux_SelectedCh = 1;
ANA_MUX_SET_TEMP;
ADC_EOC_ClearPending();
ADC_EOC_Start();
ADC_SAR_StartConvert();
Get_Temps = false;
}
if (Get_Brt){
/*After 1 Read of Temperature Sensor*/
ADC_EOC_Stop();
ADC_SAR_StopConvert();
while (!ADC_SAR_IsEndConversion(ADC_SAR_RETURN_STATUS));
ADC_SAR_GetResult16(); //Clear last conversion
ADMux_SelectedCh = 0;
ANA_MUX_SET_BRT;
ADC_EOC_ClearPending();
ADC_EOC_Start();
ADC_SAR_StartConvert();
Get_Brt = false;
}
}
My interrupt code takes the most recent conversion and generates a moving average:
#define BRT_NUM_READS 32
#define TEMP_NUM_READS 8
volatile uint16_t BrtReadings[BRT_NUM_READS];
volatile uint16_t TempReadings[TEMP_NUM_READS];
volatile uint16_t ADC_Brt_Avg = 0;
volatile uint32_t ADC_Brt_Sum = 0;
volatile uint16_t ADC_Temp_Avg = 0;
volatile uint32_t ADC_Temp_Sum = 0;
uint8_t ADMux_SelectedCh = 0;
void ADC_EOC_Interrupt_InterruptCallback(void){
/*We get here whenever a conversion is finished*/
static uint8_t brt_index = 0, temp_index = 0;
uint16_t adc_val = 0,prev_brt_val = 0,prev_temp_val = 0;
ADC_EOC_GetState();
adc_val = ADC_SAR_GetResult16();
switch (ADMux_SelectedCh){
case ANA_MUX_BRT_CH:
prev_brt_val = BrtReadings[brt_index];
BrtReadings[brt_index++] = adc_val;
if (brt_index >= BRT_NUM_READS){
brt_index = 0;
}
ADC_Brt_Sum += adc_val;
ADC_Brt_Sum -= prev_brt_val;
ADC_Brt_Avg = (ADC_Brt_Sum >> 5); //Bitshift divide by 32
break;
case ANA_MUX_FANTEMP_CH:
prev_temp_val = TempReadings[temp_index];
TempReadings[temp_index++] = adc_val;
if (temp_index >= TEMP_NUM_READS){
temp_index = 0;
}
ADC_Temp_Sum += adc_val;
ADC_Temp_Sum -= prev_temp_val;
ADC_Temp_Avg = ADC_Temp_Sum >> 3; //Bitshift divide by 8
Get_Brt = true; //Flag to switch back to brightness input on mux back in main()
break;
}
ADC_EOC_ClearPending();
}
Is this viable? Are there considerations I'm not taking into account to accomplish something like this? My main concern is the stopping/starting of the ADC Conversion process in Svc_Ana_Mux, and the effects that might have on readings once I start the ADC again (as I've noticed my thermal sensor readings seem to get some "rogue" points). Possibly any way to make sure the SAR ADC is "Cleared" before switching to the other input?
Thanks in advance for any pointers!
Show LessI've developed my code in the DEBUG configuration. It runs and works well on my target. When I try to run the RELEASE version it does all sorts of craziness and just doesn't work right. I've been through the project settings and can't find any differences between the two configurations. Can someone look at my project and help me out?
Show Lesshello i am new to using cypress ,so i have a question. i want to meassure voltage across the POTENTIOMETER and show the voltage across my computer screen ? is it possbile ? from what i learned so far I need to use Anlog Digital Convertor but i cant really undestand how to use it . could any one help me ?
about my the pins of my POTENTIOMETER are as follows :
1)left pin to the ground
2)middle pin to one of the ports of the Cypress
3)right pin to Vdd .
Show LessHello,
I'm using the KitProg (CY8C5868LTI-LP039) as a USB_UART bridge to turn on LEDs connected to the target board (CY8C5888LTI-LP097).
I'm trying to turn on another LED using GPIOs on CY8C5868LTI-LP039 header J8.
PC will send commands to turn on LEDs on the KitProg and target board at the same time.
The reason I want to use GPIOs on the KitProg is that the target board (CY8C5888LTI-LP097) is custom made and I am not able to get GPIOs there.
My understanding is the KitProg is used for programming and debugging.
But, is there any way to use the KitProg as a USB_UART bridge and connect LEDs to it?
Thank you.
Show LessI have a situation where I have two slave devices with the same address. How do I communicate with both of them? Our hardware is configured such that both slaves share the clock pin but have separate data lines. This approach worked well with another processor. How do I handle this with a PSoC? The schematic below doesn't work because the mux is not bidirectional. Is this a situation where a multi master architecture would be a solution? If so, is there an example of how to implement such a system?
Show Less