PSoC™ 5, 3 & 1 Forum Discussions
Hi
I am trying to config my DMA to send my buffer to SPIM.
I configured my DMA and SPIM.
They work with standard 8 it data transfer but do not work with 16 bit config.
would you please take a look at my code and let me know where is the problem.
I already tried both uint8 and uint16 for my buffer definition.
non of them work.
Regards
Show LessDear All;
As a complete beginner I am following this guide: Cypress CyUsb3.sys Programmer's Reference.
I have completed all the steps for Modifying CyUSB3.INF section.
I deduce that from figure below because in the guide I have been following it is mentioned that If the displayed driver file is CYUSB3.SYS
Windows has already matched the device to this driver and you should click OK and Cancel . If not, proceed with the remaining steps.
I can also transfer data using Cypress USB Console. To do this I; first change the CYUSB.sys to CYUSB3.sys as in the figure below.
When I change into CYUSB3.sys my device appears in USB Address 1.
Also in the cyusb3.inf file I have this line : CYUSB3.GUID="{BC65166E-F256-45C6-A61F-0712F462B635}" which matches with the number above.
Now I can send the data OUT as you can see in the figure below:
However, when I try to detect the same device in the C++/Visual Studio 2015 environment, I face the following problem.
I assign a handle and check it afterwards.
InitializeComponent();
CCyUSBDevice *USBDevice = new CCyUSBDevice();
HANDLE hDevice = USBDevice->DeviceHandle();
if (hDevice == INVALID_HANDLE_VALUE) {
textBox1->Text = textBox1->Text + "INVALID_HANDLE_VALUE \r";
}
if (hDevice != INVALID_HANDLE_VALUE) {
textBox1->Text = textBox1->Text + "VALID_HANDLE_VALUE \r";
}
Then I check number of devices which are attached by the following line
int devices;
devices = USBDevice->DeviceCount();
textBox1->Text = textBox1->Text + "\r\n";
textBox1->Text = textBox1->Text + "Number of devices : \r";
textBox1->Text = textBox1->Text + System::Convert::ToString(devices);
When I execute the code I see the following:
So the handle is valid but number of devices are 0 which means the device attached is VISIBLE in the Cypress USB Console but now in the C++ code.
So can you help me about that problem?
How can I make it visible and use it in my C++ code?
You can find the full code at the end.
Looking forward for your reply...
----------------------FULL CODE-----------------------
#pragma once
#include <stdio.h>
#include <wtypes.h>
#include <dbt.h>
#include "CyAPI.h"
#include <SetupAPI.h>
#include <CyUSB30_def.h>
#include <Mswmdm.h>
#include <windows.h>
#include <winioctl.h>
#include <iostream>
#include <vector>
#include <array>
#include <stddef.h>
#include <wchar.h>
#include <locale.h>
#include <fstream>
#include <cyioctl.h>
namespace CyPressDataYollama {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::ListBox^ listBox1;
public:
MyForm(void)
{
// Get the handle.
InitializeComponent();
CCyUSBDevice *USBDevice = new CCyUSBDevice();
HANDLE hDevice = USBDevice->DeviceHandle();
if (hDevice == INVALID_HANDLE_VALUE) {
textBox1->Text = textBox1->Text + "INVALID_HANDLE_VALUE \r";
}
if (hDevice != INVALID_HANDLE_VALUE) {
textBox1->Text = textBox1->Text + "VALID_HANDLE_VALUE \r";
}
int devices;
devices = USBDevice->DeviceCount();
textBox1->Text = textBox1->Text + "\r\n";
textBox1->Text = textBox1->Text + "Number of devices : \r";
textBox1->Text = textBox1->Text + System::Convert::ToString(devices);
/*
textBox1->Text = textBox1->Text + "\r\n";
textBox1->Text = textBox1->Text + "USB Handle : \r";
textBox1->Text = textBox1->Text + System::Convert::ToString(Handle);
textBox1->Text = textBox1->Text + "\r\n";
textBox1->Text = textBox1->Text + "Number of Devices : \r";
textBox1->Text = textBox1->Text + System::Convert::ToString(devices);
*/
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~MyForm()
{
if (components)
{
delete components;
}
}
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->listBox1 = (gcnew System::Windows::Forms::ListBox());
this->SuspendLayout();
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(12, 12);
this->textBox1->Multiline = true;
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(642, 317);
this->textBox1->TabIndex = 0;
//
// listBox1
//
this->listBox1->FormattingEnabled = true;
this->listBox1->ItemHeight = 16;
this->listBox1->Location = System::Drawing::Point(759, 181);
this->listBox1->Name = L"listBox1";
this->listBox1->Size = System::Drawing::Size(120, 84);
this->listBox1->TabIndex = 1;
//
// MyForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(1025, 544);
this->Controls->Add(this->listBox1);
this->Controls->Add(this->textBox1);
this->Name = L"MyForm";
this->Text = L"MyForm";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
};
}
Show LessI'm working with the PSOC 5LP Dev kit and a Wiznet W5500 chip. I've successfully setup communication between the two devices and I've even sent information back and forth in a loopback test. In my project folder under Design4_HTTP I've successfully taking the demo project that I found on the Wiznet Github website and I've been able to create a web server and I can access the different pages of the website. I was having a problem when I would try to turn on a LED on my Dev board from the website or read the A/D, nothing was happening. So I went to debug my project but when I would start the debugger the debugger always wants to go to the function (void * _sbrk) in the Cm3Start.C file and I couldn't get to any of the breakpoints that I set. I've tried adjusting the heap and stack size and I've played with the Device Configuration Mode but each time I run the debugger after making a change the debugger kept running to that same function. I'm looking for some help to keep the debugger from doing this so that I can figure out why the LED buttons and A/D reading are not working.
Thanks,
Matt
Show LessHi,
According to this file :
http://www.cypress.com/file/108536/download
PSoC3/5 support SPIO initiator.
I didn't use cypress board before and according to the file it seems a good board to validate SGPIO target design.
my questions :
1. Is it possible to use it to create negative scenarios ?
2. Is there any link to PSoC board components that needed to support SGPIO Initiator?
Show LessHi.
I am a new user of the PSoC family and i'm trying my luck at a small hardware node for temperature and motion monitoring. I was wondering if it is possible to drive the sensor (a DS18B) from the psoc itself onto the breadboard and if so how to do it or where I can read about it.
Thank you.
Show LessHello,
For my application, i want to read analog signal with 12 bit delta Sigma differential ADC. The Range of ADC is +-2.048v but the output of ADC for 2v of input is around 2300.Why the output is more than 2048?
Show Lessi am trying to say on a single devlopement kit i can sent data master to the slave on a same kit? if yes then how can i do ? please guide me .i am beginner on PSOC 5.
Show Less