PSoC™ 5, 3 & 1 Forum Discussions
Hi all!
I'm using DMA to transfer data from an ADC to a buffer. First of all: Everything works and I can work with the buffered Data, but then...
After a time of about 230 seconds the pulse on the 'nrq' output of the DMA component stops and therefore the ISR isn't entered.
The ADC is working with 182250 SPS at 8 bit resolution and I'm saving 50 bytes.
A DMA_release and reinitializing didn't help. The only solution I have so far is reseting the device.
Attached find the TopDesign part of the DMA. I'm meassuring on 'ADC_eoc' to check for the pulse.
The DMA Configuration looks as follows:
<p>void DMA_ADC_Buffer(void)
{
#define DMA_ADC_Buffer_BYTES_PER_BURST 1
#define DMA_ADC_Buffer_REQUEST_PER_BURST 1
#define DMA_ADC_Buffer_SRC_BASE (CYDEV_PERIPH_BASE)
#define DMA_ADC_Buffer_DST_BASE (CYDEV_SRAM_BASE)
uint8 DMA_ADC_Buffer_Chan;
uint8 DMA_ADC_Buffer_TD[1];
DMA_ADC_Buffer_Chan = DMA_ADC_Buffer_DmaInitialize(DMA_ADC_Buffer_BYTES_PER_BURST,DMA_ADC_Buffer_REQUEST_PER_BURST, HI16(DMA_ADC_Buffer_SRC_BASE), HI16(DMA_ADC_Buffer_DST_BASE));
DMA_ADC_Buffer_TD[0] = CyDmaTdAllocate();
CyDmaTdSetConfiguration(DMA_ADC_Buffer_TD[0], 50, DMA_DISABLE_TD, DMA_ADC_Buffer__TD_TERMOUT_EN | TD_INC_DST_ADR);
CyDmaTdSetAddress(DMA_ADC_Buffer_TD[0], LO16((uint32)Rx_ADC_DEC_SAMP_PTR), LO16((uint32)ADC_Buffer));
CyDmaChSetInitialTd(DMA_ADC_Buffer_Chan, DMA_ADC_Buffer_TD[0]);
CyDmaChEnable(DMA_ADC_Buffer_Chan, 1);
}</p>
Show LessNot sure if everyone has seen this -
"This spreadsheet is a basic tool for obtaining a gross estimate of power consumption using
PSoC 3 ES3 and PSoC5 ES1."
Hopefully will be done for 4 and 5LP.
Regards, Dana.
Show LessHi,
Attached is the code which demonstrate how to measure average voltage of an AC signal using PSoC1. Following is the code flow:
Analog to Digital Conversion->Rectify and accumulate the samples->check if integral number of full cycle sample is acquired->divide the sum with the total number of sample->Print the average on the LCD.
Some samples may be missed due to processing delay . In order to avoid that ADC output is collected inside the interrupt and filled into a buffer.Hope this will help.
Thanks and Regards,
Keerthy
Show LessHi,
Programming on PSoC Creator I went int trouble about the conversion from float to ASCII, i searched and found this:
http://www.cypress.com/?id=4&rID=39791
I give it a try with this code:
#include <stdio.h>
const float PI = 3.1416;
int n=0; byteswritten = 0;
float x = 0;
char str[6];
void main()
{
while (1)
{
x= sprintf(str, "%f", PI);
}
}
The conversion went good, have my string.... but "n" went affected, debug shows n = 12337, i tried changing the name... but no solution, its a big problem for me because i'll use "n" on next step, and it gets affected always in the cicle.
Show LessHello,
I have a doubt about configuring a DMA with two TDs. For example, the first TD (TD[0]) goes from position 0 to 63 of an array, when it finishes, it switches to TD[1], where it goes from 64 to 128 of that same array. The first part is done correctly, however, the second part, the DMA is not transferring correctly the array's data.
I have set up the configuration as below:
-------------------------------------------------------------------------------------------------------------------------------------
CyDmaTdSetConfiguration(dmaDescriptor[0],
TEXT_MESSAGE_LENGTH*2, dmaDescriptor[1],
(TD_INC_SRC_ADR | DMA_1__TD_TERMOUT_EN));
CyDmaTdSetConfiguration(dmaDescriptor[1],
TEXT_MESSAGE_LENGTH*2, dmaDescriptor[0],
(TD_INC_SRC_ADR | DMA_1__TD_TERMOUT_EN));
CyDmaTdSetAddress(dmaDescriptor[0],
LO16((uint32)textMessage), LO16((uint32)UART_1_TXDATA_PTR));
CyDmaTdSetAddress(dmaDescriptor[1],
LO16((textMessage[TEXT_MESSAGE_LENGTH])), LO16((uint32)UART_1_TXDATA_PTR));
-------------------------------------------------------------------------------------------------------------------------------------
I think that the problem is that I didn't set up the offset correctly (I have tried using pointers also).
Thank you in advance
Chang
Show LessHi,
I´m using the "PSOC 3 Development Kit". In my project I would like to transmit data that has been received by a SPI SLAVE to my PC.
I tried to use USB_UART with Hyperterminal and I did work, but i was to slow. I need at least a datarate of 100 kByte/s. Now I'm trying to establish the data transfer with the USBFS in the Bulk mode using USB Suite. With CyConsole I´m able to read out the endpoint, but every time I want to read the data I have to press the button " transfer data" . But i need a continuous stream of data. The programm "streamer" does not work. Does anybody know how its possible to read out an store a continuous stream of USB data?
I attached my project.Pease help me out.
Regards,
Alex
Show LessHi
I''d like to get rid off the automatic indentation in PSoC Designer as I prefer manually tabulating when needed.
The Tools/Options/Code Editor/Behavior just mentions a tab-to-space replacement, but nothing about enabling/disabling the automatic indent.
Does anybody know where this parameter (if exists) can be managed?
Regards,
Michel
Show Less