私はPSOC5LPにてSDカードを使用したプログラムを書いています。
emfileとFS.hを使用しています。
できる限り省電力にしたいため、SDカードの電源も制御しようとしています。
そのため4端子の3.3Vレギュレータを用いてsleep前にSDカードの電源を切っています。
また、SPIのCS端子もLOWに設定するようにプログラムを書きました。
#include <project.h>
#include <FS.h>
#include "stdio.h"
FS_FILE * pFile;
int main()
{
CyGlobalIntEnable; /* Enable global interrupts. */
CONS_Start();
FS_Init();
while(1){
SD_Power_Write(1);
emFile_SPI0_CS_Write(1);
pFile = FS_FOpen("\\data\\4.csv", "a");
if(pFile)
{
if(0 == FS_FClose(pFile))
{
CONS_PutString("File was closed\r\n");
}else
{
CONS_PutString("Failed to close\r\n");
}
}else{
CONS_PutString("Failed to write file\n");
}
SD_Power_Write(0);
emFile_SPI0_CS_Write(0);
CyDelay(5000);
}
return 0;
}
こちらのプログラム実行結果が下記の内容です。
Start
File was closed
Failed to write file
Failed to write file
Failed to write file
Failed to write file
Failed to write file
Failed to write file
電源を一度切るとその後はファイルを開くことができません。
電源を切る前に実行すべきメソッドがあるのでしょうか?
それともそもそも電源を切ってはならないのでしょうか?
追記:
回路図と使用部品を記します。
microSDソケット:https://akizukidenshi.com/catalog/g/gK-05488/
SD電源用4端子レギュレータ:https://akizukidenshi.com/catalog/g/gI-09261/
主電源DCDC(3.3V出力):https://strawberry-linux.com/catalog/items?code=12060
Show LessHello,
I am using a time-stamp method of measuring a frequency of a signal. The signal is a square wave, and causes a DMA transfer to start when a rising edge is detected. There is a circular RAM buffer that holds the timestamps / counts of the timer each time the input signal has a rising edge. A function is called periodically to subtract the counts from each other to estimate the frequency.
I used the example project from the CONSULTRON which is posted here:
https://community.cypress.com/t5/Code-Examples/Multi-Input-Frequency-Measurement-Tutorial/m-p/183038
Everything works as expected when I use the "Fixed Function" timer block with 16-bits. However, when I try changing it to a 24 or 32-bit UDB timer block, the counts do not make sense. The least-significant-byte of the RAM buffer always has the same value for some reason. When I look at the debug window for the component, the count matches what is expected in the MEMORY viewer, but it seems like the value at that address is not being transferred via DMA?
I referenced AN61102 which shows how to transfer 32-bit values from 16-bit spokes. I added another DMA channel as an intermediate step, and from the intermediate step goes to the larger buffer.
I was using the following #define in the DMA configuration to retrieve the counts, which is 0x4000_6508: Timer_Count_COUNTER_LSB_PTR_8BIT
Show LessDear Cypress Community,
I am using an evaluation board for PSoC 5LP (CY8CKIT-059) and trying to downmix a signal.
My aim is to downmix a noisy signal that contains a very small sine wave (1mVpp) whose frequency is known, e.g., 10 MHz. The DC value I would get after the mixing+filtering tells me if that sinewave is present in the signal or not.
I was able to achieve this only for sine waves of max. 4 MHz using the mixer component of 5LP.
Question: Is it possible to mix with a frequency higher than 4 MHz so that I can downmix a 10 or 15 MHz signal?
I ask this because I do not want to include/pay a separate (I-Q) demodulator in my design.
Cheers,
Matija.
Show Less
I just inherited code that sets a reserved bit that does make a difference in a capsense measurement. When the reserved bit is set I get "proper behavior" . I did not set this bit in a test and the capsense was reading out raw data at 255 range when it should have been reading 0. To get this design to work this bit has to be set. What does this bit do and how in the world could of my predecessor known to set it????
This bit is bit 7 in CS_CR3 that is being set by the following code segment.
CS_CR3 |= 0x90; // Reference buffer to drive the analog global bus. Bit 7 is not used so why was it set? Reserved bits should not be set. Without it the raw capsense value reads 255 instead of 0
// CS_CR3 |= 0x10; // Reference buffer to drive the analog global bus. Causes 255 to be read in raw value instead of 0 .
Then the capsense code below this.
Show Less
Can someone please tell me what this means?
this happens when i add ist module and connect it to uart tx_en port
im really bad at this, just trying to follow a video lecture
hope someone helps me..
Show LessHello.
Customer used CY8C5868LTI-LP039.
And they used EEPROM and DieTemp components.
When die temperature measurement is started, writing to EEPROM becomes fail.
If DieTemp_1_Start () is not called, EEPROM_1_Write () will succeed.
But EEPROM_1_Write () will fail if there is DieTemp_1_Start ().
Error status is CYRET_UNKNOWN.
Why is EEPROM_1_Write () an error?
And could you please let us know a method that EEPROM_1_Write () will succeed even if there is DieTemp_1_Start ().
Best Regards.
Yutaka Matsubara
Show LessHi,
Can we just implement TPS25982 block diagram to PSoC5LP MCU. I am attaching the link for datasheet of TPS25982 and the functional block diagram
Page No:18
Please do let me know in full brief about the different blocks.
Show Less
To all,
A question was asked on an earlier form post about supporting more than 8 digits on a 7-segment LED display.
Post: LED-Driver-with-10-commons-how-it-is-possible
It is possible to support up to 24 digits with with the Cypress/Infineon LED Segment and Matrix Driver (V1.10).
Using this driver, there are only up to 8 commons supported. To use this driver for more than 8 digits you need to allocate more segments per common. This is referred to on pages 30 and 31 of the datasheet.
For example to allocate 24 digits of 7-segments (really 8-segments) you need to do the following in the configuration for 8 commons and 24 segments. If you need 16 digits you can allocate 8 commons and 16 segments. For 15 digits, 5 commons and 24 segments.
In other words, let's say you need 'x' digits. Then you need a minimum of 'y' commons. ROUNDUP(y = x/3)
segments 0-7 are used for the first set of digits (1 to x/y) and segments 8-15 for the next set ((x/y)+1 to 2x/y) and (if needed) segments 16-23 for the last set ((2x/y)+1 to x).
Each digit can be accessed in the API calls using the "position" variable.
The downside of sharing commons across digits is that it requires more current to be sourced or sunk. This can be achieved by using external components such as NPN and PNP transistors.
As a parting note: I have provided a new LED matrix driver component that can allocate up to 16 commons. This is a functional extension of the Cypress component. This component allows for separate commons drive for up to 16 digits if you need it. Additionally in a similar manner this new component can handle up to 48 7-segment digits.
The new component can be found at: Code-Examples/New-LED-Matrix-Driver-Component-Max-24-Segments-and-Max-16-Commons
Show LessHi All,
I am working with IC cy8c29466, I just burn the code in IC and checked on hardware and I am getting ADC counts then I tried with another piece of IC and my ADC counts get variation near about 15-20 counts, I applied same input voltage, same code I burned, even the PCB is also same, every IC showing different different counts, the variation near about 15-20 counts, I don't understand what's wrong with it.
suppose an example at 0 millivolts ADC counts are 2 and at 500 millivolts ADC counts are 1060 for one IC
I burn the code in another cy8c29466 IC (with same PCB and same input voltages) and got the output at 0 millivolts ADC counts are 1 and at 500 millivolts ADC counts are 1047
I tried with 4 different IC every time I am getting different different counts at same voltage and same PCB, Even the ADC counts are stable and getting correct ratios with respect to input applied but due to the max. counts variation every IC have different ratio factor
I don't understand what's wrong with it, may be it is issue of tolerance of IC ? please suggest something how to resolve this issue ?
Thank You.
Show Less
Does this device have input voltage ripple or spike regulations?
Ripple will occur up to 130mVp-p at 5V in low temperature conditions. LVD is set to 4.81V(Typ), but it has not been reset. (VM[2: 0] = 111b)
Thanks,
Tetsuo
Expert II
Honored Contributor II
Honored Contributor
Esteemed Contributor
Esteemed Contributor
Valued Contributor II
Honored Contributor II
Employee