PSoC™ 5, 3 & 1 Forum Discussions
If I build the original code, the SD card loos its format. So I create a new one from the beginning, but this new cant write (create) the archive. Appears that the fp = SDCard_fopen(helloFile, "a") and the SDCard_fputcs("HelloWorld", fp) are not working.
My C code is the next
//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Hello World Sample Project
//
// Description:
// This is a simple example of what it take to write a string to a SD Card File.
//
// Program Flow:
// 1) Wait for card to be inserted.
// 2) Initializes card interface.
// 3) Opens file "hello.txt" for writing. If not there it creates the file.
// 4) Writes the string "Hello World" with a CR and LF.
// 5) Closes the file. Then goes back to step '1' and waits for card to
// be inserted.
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#define CARD_PRESENT 1
#define CARD_NOT_PRESENT 0
char helloFile[] = "hello.txt";
void main()
{
char cardInfo; // Card information
char fp; // File Pointer
BYTE CardState, oldCardState; // Card inserted state variables
BusyLED_Off(); // Make sure LED is Off
oldCardState = CARD_NOT_PRESENT; // Initialize card insertion state
SDCard_Start( ); // initalize hardware and SDCard_lib buffers
while(1)
{
CardState = SDCard_Present(); // Get current card insertion state
if(CardState != oldCardState) // Check for a change
{
oldCardState = CardState; // Save last state
if(CardState == CARD_PRESENT) // Card inserted
{
BusyLED_On(); // About to talk to card, turn on busy LED
SDCard_Select(SDCard_ENABLE); // Select card
cardInfo = 0;
while ( ! cardInfo ) // Wait for card to communicate
{
// initialize card, determine card type and file system type
cardInfo = SDCard_InitCard();
}
fp = SDCard_fopen(helloFile, "a"); // Open file to append data
SDCard_fputcs("HelloWorld", fp); // Write string
SDCard_fclose(fp); // Close file
SDCard_Select(SDCard_DISABLE); // Deselect card
BusyLED_Off(); // Turn off busy LED
}
}
}
} Show Less
Welcome to the Cortex-M3 PSoC 5 Design Challenge, brought to you by ARM, EETimes and Cypress. In this forum you will be able to track all of the latest announcements regarding this exciting design challenge.
Let the games begin!
-Bobby
Show LessI have been using the 1.20 UART on an RS-485 bus configuration and the network ceases to operate when undating to 1.50 (I changed the number of bits setting after the update, but nothing else).
When I put a logic analyzer on the bus it looks like the 1.20 version introduced a slight amount of inter-byte delay, as indicated by little pulses on the Tx Enable line, but this is not so with the 1.50 version. I am only sending about 12 bytes in a typical packet, but this seems to be long enough for differences in the baud rate clocks to create a CRC error.
When I stop using buffered transmission and thus introduce a small inter-byte delay, the network operates as before.
What I would really like to be able to do (and have for the last 10 years) is set the number of stop bits for Tx to 2 and set Rx to 1. This would be a simple way to still use buffered transmission and get a little delay for re-framing each byte. There may be a way to select an inter-byte delay through the API, but I haven't found it.
I'm curious if others have faced the same situation, and what some possible solutions are. Plus if enough chime in, may Cypress will address this...
Thanks, Jim
Show LessSir,
We completed making our abstrat on our topic but when we put our model on the PSoc Creator we are facing a problem. we completed analog part of our model on the PSoc Creator but when we come to Digital part I have a doubt that we have to place complete REGISTER TRANSFER LEVEL Diagram in the PSOC Creator or not? OR else I roughly draw block diagrams mentioning their functionality?
Please also mention us which family of PSoc5 we will be using in our further stages ?
Awaiting for our reply,
Regards,
Narra.
Show LessI have 2 projects on my list, one with the block diagram and one with the creator project. Request the admin to merge them into one.
Thank You.
Show LessHi,
What is the deadline for Phase-1?. There is a discrepancy in the date noted in "Getting Started" (Jan-17) and "Rules"(Jan-10) links on the contest page.
Thanks,
Show LessHi all,
I'm thinking about using a PSOC (CY8C24794) in a project and would like to know if I can assign a PWM block to multiple outputs, i.e. I'd like to dim 8 independent LEDs. I appreciate I could do this with hardware but it would be a huge advantage if I could do this on chip.
Thanks for your time on what I know is a datasheet question.
Cheers
Chris
Show LessHi all,
I have a problem with the UART on the PSoC 5 and the CY8CKIT-001 development kit. What I am doing, is sending (Modbus) data via a serial to USB cable from the PC to the device. When using Realterm to send the data packet to the device, everything works fine, every time. However, if I send the data packet from a C# app using the .net SerialPort class, some bytes get scrambled at the device side. This does not happen every time, but actually most of the time. I used the same C# app on a PIC Modbus devce that I built, and it works fine every single time.
I actually resorted to go to Java, using the RXTX library to send the Modbus packet to the device. However, the same happens from the Java app.
How can this be, that the data gets to the device correctly when I am using Realterm, but when I am using any other custom app, some bytes get scrambled?
Please help me with this
Show LessI'm excited to announce that we have officially extended Phase 1 of the Design Challenge to January 24th. We had requests from people who wanted a little bit more time, and there was also some confusion as to what date Phase 1 ended due to some conflicting information on the website.
I hope the later date allows anyone who was thinking about submitting, but hadn't yet, time to finish.
-Bobby
Show Less