PSoC™ 5, 3 & 1 Forum Discussions
Hello. I've been beating my head trying to make this work. PSoC 3 processor, ADC to DMA to memory. Everything seems set up right but the DMA result memory location never gets the value. If I read the ADC directly I get a good value, so the ADC is working. The ADC interrupt is firing because I can breakpoint it there, and I can see that the ADC_convDone flag is set.
I've gone round and round with the documentation and think everything is set up right. But the DMA screens in Creator 4.4 do not exactly align with the documentation.
The one thing I cannot find is exactly how to set up the TD for my scenario. I have the ADC converting continuously, and the TD is set up as: Endian=off, trq=off, nrq=off, length=1, source ADC_DEC_SAMP_PTR, Inc=off, dest=memory value, Auto Next=off, and Next Td=End.
I have tried Auto Next=on and Next Td=0, but that does not change anything and I don't think it is right anyway.
So here are my setup values:
/* Defines for AzDma */
#define AzDma_BYTES_PER_BURST 1
#define AzDma_REQUEST_PER_BURST 1
#define AzDma_SRC_BASE (CYDEV_PERIPH_BASE)
#define AzDma_DST_BASE (CYDEV_SRAM_BASE)
/* Variable declarations for AzDma */
/* Move these variable declarations to the top of the function */
uint8 AzDma_Chan;
uint8 AzDma_TD[1];
/* DMA Configuration for AzDma */
AzDma_Chan = AzDma_DmaInitialize (AzDma_BYTES_PER_BURST, AzDma_REQUEST_PER_BURST,
HI16 (AzDma_SRC_BASE), HI16 (AzDma_DST_BASE));
AzDma_TD[0] = CyDmaTdAllocate ();
CyDmaTdSetConfiguration (AzDma_TD[0], 1, CY_DMA_DISABLE_TD, 0);
CyDmaTdSetAddress (AzDma_TD[0], LO16 ((uint32)ADC_DEC_SAMP_PTR), LO16 ((uint32)AdRes.Az));
CyDmaChSetInitialTd (AzDma_Chan, AzDma_TD[0]);
CyDmaChEnable (AzDma_Chan, 1);
What I want is for the memory location to get overwritten with each conversion - for now.
Thanks for any insight, Russ
Hi,
attached is a simple project to test the DMA inter-spoke performance between SRAM and UDB (SPI) block.
For a MASTER_CLK = BUS_CLK = 78MHz obtained results, measured DMA data transfer time (t_DMA_DONE - t_DMA_TRIGGER), vs. expected are:
- transfer 1 * 16bit: 146 ns, calculation: Nbursts = 1, InterSpoke transfer = Nbursts + 7 = 8 (102 ns)
- transfer 2 * 16bit: 250 ns, calculation: Nbursts = 2, InterSpoke transfer = Nbursts + 7 = 9 (115 ns)
- transfer 4 * 16bit: 457 ns, calculation: Nbursts = 4, InterSpoke transfer = Nbursts + 7 = 11 (141 ns)
Can anybody advise how to reach the speed as specified in the data-sheet?
This particular program has main loop doing nothing, in real example DMA arbiter priority was raised against the CPU however no significant effect has been observed.
Kind regards,
Uros
Hi,
I use ADC_SAR but I can't find how can I get the time between samples. Maybe someone can help?
EDITED:
Hello @EvPa_264126 ,
I have used your response from this link, as a start for my firmware interfacing to the ESP-8266 with PSOC5 LP.
But I am having an issue with the WaitText() function that has been used.
The firmware doesn't 'return 1' even when the string response is received properly from the ESP (checked the UART log) and only acts as a delay for the amount of time that is specified.
I would really appreciate it if you review the attached firmware and let me know what could be the issue.
Regards,
Yash
I am working on a project for array readout. I am using CY8CKIT-059.
There are 8 analog inputs that I have to read sequentially using the ADC and AMUX.
I was wondering if there is any way I can connect all the other inputs to ground while only one of the analog inputs is connected to the ADC.
Thanks in advance
Balu
Show LessHi, all
My project is created by PSOC Creator 4.4, using CY8C5888 MCU and GCC 5.4 to build my project. In my project, ROM is used about 94%, so I have strong will to reduce ROM size.
In my project, some functions are not used, so the linker ld remove the function in elf, but strings used by those functions are kept in elf file.
I want to remove these unused strings in elf. Passing -fdata-sections to GCC compiler and make the option "Remove unused sections" as true is a good idea. While compiling source code, the compiler would create an individual section for each data. While ld linking object files to elf file, ld would remove unused data.
So I add -fdata-sections to compiler Custom Flags, and build my project again. But I saw unused strings in elf file, this method doesn't take effect.
How to make this parameter to take effect? If there is no method in current rev, I wish I could do this in next rev, because this really helps me a lot.
Show Less
due to unavailability of the CY8C5488AXI-LP120 and CY8C5467AXI-LP108 chips I designed a new card using psoc 6, in order not to throw away around 80 old boards I would need to complete them with chips that can be one of the two models.
if anyone has boards or components to sell me please contact me urgently thanks.
I have been trying to write a program that involves Digital Write and USBUART. The program doesn't seem to work for some reason.
This is a sample code. When I comment out the digital write statements, the USBUART works. And when I comment out the USBUART, the Digitalwrite works. Any idea why?
Any help is greatly appreciated.
#include "project.h"
#include <stdio.h>
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
ADC_SAR_Start();
AMux_Start();
USBUART_Start(0,USBUART_5V_OPERATION);
while(USBUART_GetConfiguration()==0){}
ADC_SAR_StartConvert();
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
for(;;)
{
/* Place your application code here. */
LED_Write(1);
CyDelay(1000);
LED_Write(0);
CyDelay(1000);
AMux_Select(0);
int pot1 = ADC_SAR_GetResult16();
AMux_Select(1);
int pot2 = ADC_SAR_GetResult16();
char print[100];
sprintf(print, "pot1 : %d, pot2 : %d\r\n", pot1, pot2);
USBUART_PutString(print);
CyDelay(100);
}
}
Show Less