PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
Hello,
i want to display a ADC result in decimal on the display. I have found something to display in float but not in decimal.
char *pResult; // Pointer used to store the result returned by ftoa function
int iStatus; // Status variable for the ftoa function
LCD_Position(1,5);
pResult = ftoa(ADC_value,&iStatus );
LCD_PrString(pResult);
regards Alex
Show Lesshey ,i'm trying to make a project on power-line telephony..i've read many articles on PLC but couldn't arrive at what all hardware is required alongwith the PowerPSoc to go about in this project...pls guide me
regards
Show LessMy next problem is some program to send and receive data from the multiple slaves on the 485 connection. Suggestions please. Show Less
Question 1:
How to use CRC16 module to calculate an data array's CRC result ?
In order to use TX8 module to send out the "data+crc" by H/W CRC.
Question 2:
code from cypress web --- S/W CRC16
unsigned short ComputeCrc(unsigned char *Buffer, unsigned char Length, unsigned char Seed)
{
unsigned char Data;
unsigned char Count = 0;
// Load the CRC with an initial value.
unsigned short Crc = (unsigned char)Seed;
// loop through all bytes in the buffer
while (Count < Length)
{
Data = Buffer[Count];
// Update the CRC for transmitted and received data using
// the CCITT 16-bit CRC algorithm (X^16 + X^12 + X^5 + 1).
// The next 5 lines take 143 bytes
Crc = (unsigned char)(Crc >> 😎 | (Crc << 8);
Crc ^= Data;
Crc ^= (unsigned char)(Crc & 0xff) >> 4;
Crc ^= (Crc << 😎 << 4;
Crc ^= ((Crc & 0xff) << 4) << 1;
Count++;
}
return Crc;
}
if use Polynomial as (X^16 + X^15 + X^2 + 1) , how to change the code?
Trying to build fine frequency meter I discover that capture function fail to work in case of external measuring signal used.
I use sequential capturing on terminal count of Counter_1. Then I calculate difference between two neighbor FIFO values.
See attached setup.
If I use as test signal internally generated Clock2 everything works fine.
But in any case of using external signal from the port pin(doesn't matter as digital input or analog with comparator) lead to zeroes in FIFO status bits.
This is absolutely the same for PSOC3 and PSOC5. Tests were done on CY8KIT-003 and CY8KIT-014.
Show LessAll,
I am using the CY8CKIT-001 PSoC-5 demo board and have been able to get the 16-bit ADC example to work in "diff" mode, and then send the data out using the USBUART example. I use the original switch routine to start the conversion, then I turn on an LED showing the the DMA is done, then use another switch to dump the data out the USBUART portion.....BUT.... when I try to setup my array to bigger than 2,000 and do an ADC sample, I end up with a bunch of 0's in the reset of the array. Example, if I wanted to make my array 20,000 samples, only about the first 2000 samples are actual data, while the rest are all 0's. (it varies from acquire to acquire)
the uint16 should be 0 -- 65535 values so that should be ok. The code is exactly as the original Cypress example. I have just changed the NO_OF_SAMPLES to a larger number.
#define NO_OF_SAMPLES 2000
uint16 ADC_sample[NO_OF_SAMPLES]={0};
The array of 2,000 works fine, along with a sample rate of upto 100,000Sps. Verified with sig-gen and Excel. I don't understand why changing the array won't work. Even changing it to 3,000 samples doesn't work. Why / Where is the array/DMA transfer limitation?
Any ideas????
Keith
Show Lesshi..
i am working with RTC code provided in example code,
but it gives some problem
after successful compilation & programming
program dose not shows the required output
its min variable &one letter(last) of day get disappear
i need continuous running rtc code.
plz go through attached code
thank you
On Thursday, November 11th, there will be a free PSoC 5 workshop at the ARM TechCon. The session is from 11:00am to 1:00pm and will be held on the show floor.
The ARM TechCon is being held at the Santa Clara Convention Center. Hope to see those in the Bay Area there.
-Bobby
Show LessHi,
I got the PSoC FirstTouch Starter Kit with cyfi Low-Power RF (CY3271) and I have a questions about the Data Rate.
I know that the data rate varies dynamically between 125 kbps and 1 Mbps.
Is it possible to read out the actual data rate?
I want to read out the data rate over a longer period.
thanks, Nico