PSoC™ 5, 3 & 1 Forum Discussions
Hello !! Thanx everyone to solve my previous query so quickly.. 🙂
i am facing a simple problem that i have made my sub modules of voltage measurment, voltage averager, probe logic and frequency measurment individually and everything is working fine !! But when i combine them all in main module using switch case, the frequency measurment part doesn't work.. any idea why it is creating such problems ?? i have attached my code along with my post..
Show LessHello !! I have made a simple demo project of voltage measurment upto 5 volts in psoc.. it is working fine upto 2.49 volts.. but when i increase the voltage level greater then that voltage goes in negative values..
that means for 0 < Voltage < 2.499 volts, it displays proper values on lcd.. but for 2.5 volts it shows -2.5 volts and starts gradually decreasing as i increase voltage further.. for 5 volts it shows exact 0 on lcd..
so i made simple conversion logic to add simple 5 volts for values in between 2.5 to 5 volts to display it properly on lcd..
i am using psoc dev kit on 5 volts.. why i am facing that problem any guess ??
i have attached the peoject along this post..
Show LessPSoC3/PSoC5 device has multiple sources which can reset the device.
- WatchDog
- Low Voltage Detect Analog, LVI-A
- Low Voltage Detect Digital, LVI-D
- Software Reset and so on
Once the device is reset it is possible to identify the source of reset by reading the value of the register, RESET_SR0. However this register is read on clear. When the reset is triggered and the device boots, the device by default waits for bootloader and in the bootloader code this register is read and the status is cleared. However before reading this register the code preserves this register value as a variable, uint8 CyResetStatus.
Hello everyone. I just order a ADC chip from analog devices. Which is ADE7763. This is classical ADC unit which is working on MODE2.
I started to write program and i will check is it works, or not next week. But it is my first time to use SPI communication so i want to if you guys check it and tell me its okay?
I added just one digital clock SPIM. MOSI=P0[1], SCLK=P0[3], MISO=P0[0], CS(SS)=P1[0] and MISO is set to "async".
In ADE7763, first of all I need to send 3x8bit data for write. After that master send 8bit data and ADE7763 answers 2x8bit data (MSB-LSB) (As i understand)
ADE7763: http://www.analog.com/static/imported-f ... DE7763.pdf on page 5.
So i wrote that program;
BYTE Port1Shadow;
int i,k;
int VoltMSB, VoltLSB;
int VoltageResult;
int myInt = 10;
char str[7]=""; // String to hold the ascii result
BYTE data=0x80;
BYTE data2=0x00;
BYTE data3=0x0C;
BYTE x;
void GetVoltage()
{
Port1Shadow &= ~0x01;
PRT1DR = Port1Shadow;
SPIM_Start(SPIM_SPIM_MODE_2 | SPIM_SPIM_MSB_FIRST);
SPIM_SendTxData(0x16);
LCD_Position(0,7); // Place LCD cursor at row 0, col 5.
x=SPIM_bReadRxData();
LCD_PrCString(" U= V"); // Print "PSoC LCD" on the LCD
SPIM_SendTxData(0x00);
LCD_Position(0,10); // Place LCD cursor at row 0, col 5.
VoltMSB=SPIM_bReadRxData();
SPIM_SendTxData(0x36);
LCD_Position(0,10); // Place LCD cursor at row 0, col 5.
VoltLSB=SPIM_bReadRxData();
VoltageResult= (256*VoltMSB)+VoltLSB;
itoa(str, VoltageResult, myInt);
LCD_PrString(str); // Print "PSoC LCD" on the LCD
SPIM_Stop();
Port1Shadow = 0x01;
PRT1DR = Port1Shadow;
}
void main(void)
{
Port1Shadow = 0x01;
PRT1DR = Port1Shadow;
LCD_Start(); // Initialize LCD
/*Port1Shadow &= ~0x01;
PRT1DR = Port1Shadow;
if(PRT1DR == Port1Shadow)
{
SPIM_Start(SPIM_SPIM_MODE_0 | SPIM_SPIM_MSB_FIRST);
SPIM_SendTxData(data);
x=SPIM_bReadRxData();
SPIM_SendTxData(data2);
x=SPIM_bReadRxData();
SPIM_SendTxData(data3);
x=SPIM_bReadRxData();
SPIM_Stop();
Port1Shadow = 0x01;
PRT1DR = Port1Shadow;
} While(1)
{
GetVoltage();
}
What do you think about that program or what will you suggest ?
After Parallel DAC and Dithering techniques, the next trick to create four DAC outputs using a single DAC, the SC/CT blocks, an LUT and the DMA.
The four SC/CT blocks are configured as Track and Hold circuits whose inputs are connected to the VDAC8. A four byte array in the RAM holds the values for the four DAC outputs. The DMA reads from this four byte array and writes to the DAC in sequence. An LUT component generates the trigger for the DMA and the Track and Hold circuits. The sequence goes like this.
DMA updates VDAC with the first value, LUT generates the strobe for the TrackAndHold1 and the output of the DAC is held on output1.
The LUT generates a trigger to the DMA which updates DAC with the second value. LUT generates a trigger to TrackAndHold2 and Output2 now has the 2nd DAC value.
This repeats for all the four DAC values and the cycle continues.
The refresh rate is chosen fast enough such that there is very little droop in the TrackAndHold outputs. Also, there is no CPU overhead as everything is taken care of by the DMA. The only overhead for the CPU is to update the RAM array with the desired DAC value. As the TrackAndHold has low output impedance, there is no need to buffer the outputs.
I need to use two comparators with hysteresis and a digital analog converter but I can only analog blocks using a comparator with hysteresis, a PGA and ADC
Show LessI'm having touble establishing a UCB communication with the PSoC5 on the starter kit. Some background, I have already:
- Downloaded Cypress Suite USB 3.4.6
- Read http://www.cypress.com/?app=forum&id=2233&rID=45003 and connect to r22/r23 as instructed (and thereby voided my warranty ;^)
- Built the USB firmware in the USB suite (USBFS_Bulk_Wraparound-000) for the PSoC5 and programmed the First Touch hardware.
When I plug my jerry-rigged USB device into my PC, Windows informs that "One of the USB devives attached to this computer has malfunctioned." I was hoping for a simple "not recognized" but got a "malfunctioned" (!).
Damn the torpedoes full steam ahead, I have modified CYUSB.inf multitple different ways in multiple different places. I've placed it in .../Driver/bin/wxp/x86 and /x64 since I am on Win7. The driver declines to load.
Looking thru device manager, I find an unknown USB device with a matching Device Class GUID but no VID/PID when I was expecting 0x04B4/0x8051. I think the enumeration process failed pretty badly. I don't blame the driver for not loading.
I attached a scope to D+/D- and found pretty reasonable look behavior. D+ is pulled high and D- is pulled low (I believe, identifying it as USB-FS). I see a number of transaction flit by on the scope. The signals appear differntial and at rational voltage levels (0V/3.3V). The pulse widths in the transactions are consistent with 12MHz operation (integer mulitples of 83nsec).
I cannot identify a fault in the hardware or firmware and yet can't attach the USB device....help?
-bill
P.S. Who thought the best (and only) way to display information from the First Touch Kit was "the wave"? My arm is tired damn it.
Show LessI had a FirstTouch starter kit, CY8CKIT-014. I like to use the USB port to send ADC data back to PC.
According the schematics there are two pairs of SWD signals, one wired to USB D+/D- pins, and the other to regular SWD pins. What is the default setting of this board? Is there a way allowing me to use SWD for programing and free the USB pins for my application?
Show Less
Could I use DMA for read a 16 bit data from a master SPI and transfer the data on two 8 bit control registers?
Since the SPI works at very low frequency (1MHz), I need to update both registers only at the end of the reading procedure.
It is enough only one DMA channel or the procedure requires two different transfers ( SPI->RAM, RAM->control register), thus two DMA channels?
Thanks in advance