PSoC™ 5, 3 & 1 Forum Discussions
text.format{('custom.tabs.no.results')}
Hello,
I am trying to connect a terminal (TerraTerm) to my PSoC 5LP kit(CY8CKIT-050) so I could print something out to a terminal.
With my PSoC4 kit, I would just use a UART SCB component for this purpose. Then connect the board and my workstation with a USB cable. It appears as a COM port that I use for TerraTerm setup.
I wonder if it works similar with the PS0C 5LP kit. If so then it's not clear what pins I should use for TX and RX lines? If the setup is not similar to the PSoC4 kit then what should it be? All I want is to be able to print something to a terminal window.
Thank you for your help!
Nikolay
Show LessHello,
I want to create a .txt file and save it on my sd card.
I using the emfile component and use his example project.
I using a PSOC 5LP097 KitProg: CY8C5868LTI,a screen, a Micro-SD card adapter from Catalex and a 4Go SD card.
I made a schema for your understanding.
So when I want to launch my project all the step look like they works but at the end, there is nothing on my SD card.
And sometimes when I create a file on the sd card from a computer, PSoC or somethings else erase him.
finally I've got another probleme, at the first step, PSoC want to know the sd card name BUT he wrote on the LCD "mmc:0:" what is it ?
Thank for your help
Show LessI have a calling routine (read32reg) that passes a readBuffer to routine (readfromspi). In the readfrom spi routine I do receive correct data (4 bytes) from the device. However, when I pass the array back to read32reg (which have correct values 0x01 0x30 0xCA 0xDE), "buffer" ends up with values 0x01 0x01 0x01 0x01
But, if I set up a local buffer in the spi routine I get correct data in that buffer 0x 01 CA DE
Not sure if I am not handling the pointers properly or maybe something is being optimized out. (Though the debug window does not indicate the buffer elements as optimized out.
Originally I was putting spi values directly into "readBuffer" but I could not access the elements in debug window so I created a local array "rxBuf" that holds received values so I could verify they were correct.
Thanks, code below
//Calling C routine
uint32 read32reg(int regFileID,int regOffset)
{
uint32 regval = 0 ;
int j ;
uint8 buffer[4] ;
dwt_readfromdevice(regFileID,regOffset,4,buffer); // Read 4 bytes (32-bits) register into buffer
for (j = 3 ; j >= 0 ; j --)
{
regval = (regval << 😎 + buffer
}
return regval ;
}
//Declaration in ".h" file
extern int writetospi(uint16 headerLength, const uint8 *headerBuffer, uint32 bodylength, const uint8 *bodyBuffer);
//Routine in ".c" file
int readfromspi(uint16 headerLength, const uint8 *headerBuffer, uint32 readlength, uint8 *readBuffer)
{
int i=0;
volatile unsigned char rxbuf[4];
CyGlobalIntDisable;
CS_Write(0);
for(i=0; i<headerLength; i++)
{
SPIM_WriteTxData(headerBuffer); //write command to device
while(!(SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)){}; //wait till sent
readBuffer = SPIM_ReadRxData() ; //read any received data
}
for(i=0; i<(int)readlength; i++)
{
SPIM_WriteTxData(0x00); //dummy write for each byte to read
while(!(SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)){}; //wait till each byte done
//readBuffer = SPIM_ReadRxData() ; //read any received data
rxbuf = SPIM_ReadRxData();
readBuffer = rxbuf[1];
}
CS_Write(1);
CyGlobalIntEnable;
return 0;
}
rxbuf[4] 0x20007F14 (All) volatile unsigned char [4]
0 0x30 '0' 0x20007F14 (All) volatile unsigned char
1 0x01 '\001' 0x20007F15 (All) volatile unsigned char
2 0xCA '\312' 0x20007F16 (All) volatile unsigned char
3 0xDE '\336' 0x20007F17 (All) volatile unsigned char
buffer [4] 0x20007F5C (All) uint8 [4]
0 0x01 '\001' 0x20007F5C (All) unsigned char
1 0x01 '\001' 0x20007F5D (All) unsigned char
2 0x01 '\001' 0x20007F5E (All) unsigned char
3 0x01 '\001' 0x20007F5F (All) unsigned char
Show LessHi Team,
I am using PSOC5 development board, My requirement is to read 40 pins status continuously, Which method is to best to read 40 pins status ? The PSOC5 board support 40 interrupt ? If supports how to create 40 interrupts ?
How to much time required to read 40 GPIO status ? Please any one help on this issues .
Regards,
VV
Show LessHi all,
I've got some questions regarding a specific ADC+DMA setup I'd like to accomplish, but I'm not sure how to make it happen (I'm rather new to using DMA).
I'd like to, through DMA, have the SAR ADC cycle between 3 channels and maintain 3 separate ADC results buffers. The idea being that I could at any time read the last 8 (or really any arbitrary number) readings for any of the inputs and quickly generate an average.
My schematic looks like this:
The idea is that the PWM module provides a short (about 1.2ms) pulse from the PWM module. The rising edge starts the ADC Conversion, the EOC signal triggers the DMA to transfer the reading to SRAM, and the interrupt on the falling edge of the PWM increments the mux(es).
The PWM Period is 40ms, so there should be more than enough time to switch the analog mux for the next reading (I plan on tightening this time up once I get the general system working the way I want). The Timer and UART are just for serial reporting. I've confirmed the EOC signal is coming out of the ADC well before the falling edge of my PWM.
What's getting me stuck is configuring the DMA to properly increment the destination address and reset to the first address after 8 DMA transactions. My idea was to count the number of transfers in their respective ISRs and reset the DMA when it reaches the end of it's respective buffer. I.E.
void DMA0_Reset(void){
ADC_CH0_DMA_DmaRelease();
DMA_Ch0_Init();
}
void ISR_DMA0_DONE_Interrupt_InterruptCallback(void){
static uint8_t count = 0;
ISR_DMA0_DONE_ClearPending();
/*DMA is done transferring reading to SRAM*/
if (count++ >= ADC_BUFF_SIZE-1){
/*End of buffer, reset DMA to initial state*/
DMA0_Reset();
count = 0;
}
DMADone = true;
}
I am initializing the DMA though the autogenerated code of the DMA wizard. An init function like this one is being called for all 3 DMA channels before the main loop, as well as being used to reinitialize the channel in the Reset function:
void DMA_Ch0_Init(void){
/* DMA Configuration for ADC_CH0_DMA */
ADC_CH0_DMA_Chan = ADC_CH0_DMA_DmaInitialize(ADC_CH0_DMA_BYTES_PER_BURST, ADC_CH0_DMA_REQUEST_PER_BURST,
HI16(ADC_CH0_DMA_SRC_BASE), HI16(ADC_CH0_DMA_DST_BASE));
ADC_CH0_DMA_TD[0] = CyDmaTdAllocate();
CyDmaTdSetConfiguration(ADC_CH0_DMA_TD[0], 2, CY_DMA_DISABLE_TD, ADC_CH0_DMA__TD_TERMOUT_EN | CY_DMA_TD_INC_DST_ADR );
CyDmaTdSetAddress(ADC_CH0_DMA_TD[0], LO16((uint32)ADC_SAR_SAR_WRK0_PTR), LO16((uint32)&ADC_Data1[0]));
CyDmaChSetInitialTd(ADC_CH0_DMA_Chan, ADC_CH0_DMA_TD[0]);
}
My PWM TC (falling edge) ISR is as follows:
void ISR_PWM_Interrupt_InterruptCallback(void){
/*Falling edge of PWM, increment the mux input*/
ADC_PWM_ReadStatusRegister();
ISR_PWM_ClearPending();
if (DMADone){
DMADone = false;
switch (ADChannel){
case 0:
CyDmaChEnable(ADC_CH1_DMA_Chan, 0);
ADChannel++;
break;
case 1:
CyDmaChEnable(ADC_CH2_DMA_Chan, 0);
ADChannel++;
break;
case 2:
CyDmaChEnable(ADC_CH0_DMA_Chan, 0);
ADChannel = 0;
break;
}
MuxCtrl_Write(ADChannel);
}
}
What I'm seeing with this project is that the first ADC input readings just seem to overrun into all 3 of my ADC buffers, incrementing the destination address, but never incrementing the muxes and switching to the next channel. I have attached the project, any suggestions to where I'm going wrong would be appreciated (I'm sure there's probably a better way to accomplish this).
So as far as specific questions go:
1) How should I go about reinitializing a DMA channel back to the starting address?
2) Would I maybe be better off using a single DMA component to dump all my readings into a single buffer, then pulling out the values I want for my average with some pointer math?
3) I notice that when I set preserveTD to 1 when I enable a DMA channel, my mux switching logic and switching of buffers seems to work, but I never fill anything other than the first index of the buffer for each channel. When preserveTD is 0, the first channel just overruns all the buffers. Which of these settings should I actually be using in this case?
Thanks in advance for any assistance!
I have attached the project if someone wants to have a deeper look. I'm just trying to prototype this on a CY8CKIT-050.
Show LessI was having problems with the onboard programmer disappearing from my Windows device manager.
So at some point PSOC creator informed my I needed to upgrade the firmware on my
Cy8ckit-059 PSOC 5lp prototype kit. I did that successfully.
Now I am getting messages like this:
The run request failed. Encountered error
(Unable to acquire target device PSoC 5LP CY8C5888LT*-LP097: SWD error OK|WAIT|FAULT)
Any ideas ?
Show LessI am porting some code from STM32 across to PSOC5LP.
One of the requirements is to be able to Read the enable state of an external interrupt, disable the interrupt and then put it back into same state as before being disabled.
I have a Digital input pin going to a derived interrupt. I started it using the StartEx and can stop using Stop but what command can I use that gives result like this:
lastState = MyExtInterrupt_Enabled();
Thanks
Show LessThe DMA Wizard does not allow linking an 8-bit SAR ADC to an 8-bit VDAC.
It complains about incompatible burst sizes. The specific error is "The selected Source and Destination have incompatible Burst sizes. No valid size can be selected".
A minimal example project just containing the three relevant components added to the schematic is attached. This is enough to reproduce the error message. Also attached a screenshot of the error message.
I suspect this is due to the SAR ADC being permanently stuck in a 16-bit register configuration from the DMA's perspective, even if the component is configured with 8-bit resolution. This means that the DMA configuration assumes a minimum burst size of 2 bytes, even though a burst size of 1 byte should be fine.
In the DMA section of the SAR ADC datasheet, I see this comment about the ADC_SAR_WRK0_PTR source: "Receive a 2-byte result for a conversion with a result that always has 12-bit resolution." This supports the previous suspicion that the DMA burst size cannot shrink to match the configured 8-bit resolution.
The DMA Wizard scales the DeltaSigma ADC burst size correctly from 1 to 3 bytes as the resolution changes from 8-bit to 20-bit. The DeltaSigma datasheet also lists these burst sizes as valid lengths of ADC_DelSig_DEC_SAMP_PTR depending on resolution. I'm just surprised that the SAR ADC cannot scale burst width similarly.
Is this a bug, or just a limitation of the SAR ADC hardware?
Are there any workaround suggestions besides just using the DeltaSigma ADC instead of the SAR ADC?
I doubt it's possible to just point the DMA source address to ADC_SAR_WRK0_REG, which contains the relevant 8-bit value.
I'm thinking one option is to chain a pair of TDs that each read one byte, where the first TD passes the first byte along to the 8-bit VDAC, and the second TD just throws the other byte away.
I also found these two unresolved threads which encountered the same burst width issue.
Why I am unable to transfer data from ADC_SAR to VDAC8 Via DMA?
Show LessHi All
We have kit going out to customers who occasionally need to upgrade their code. Some of the less fortunate ones use Macs - Can we have a Mac version of PSoC Programmer, please?
Show LessHi,
We are using the Cypress bootloader to program PSoC 5LP via
serial port.
This work properly.
In addition we have an ability to program the same image
(*.cyacd) via CAN bus.
The CAN bus option works only if the programmed image is the
same size as the previous one.
If the size is different we are failing in checksum
validity.
- Can you help us to understand what is missing in the CAN bus
programmer? - Can you send us any document that describe the scenario of the
serial programming?
Thanks
Shmuel
Show Less