PSoC™ 5, 3 & 1 Forum Discussions
Hi everybody..
I am trying to receive 3 words of 16 bit each in a SPI slave from a master using interrupt on the slave side. Both master and slave are implemented on separate PSOC5 development kits. In the 1st PSOC kit(SPI Master) I am receiving some data from a GUI through UART and displaying it on LCD. Then I am sending 3 words of 16 bits through SPI master.
On the other PSOC kit I am trying to receive the words with SPI slave using interrupt and display it on LCD. From the SPI master data is sent correctly.On the SPI slave side the interrupt is getting generated correctly but the data received is random.
All the four lines(CS,CLK,MOSI,MISO) of SPI Master are connected to corresponding lines of slave.Please suggest if some hardware settings are wrong or the code itself. Thanx in advance. Please find the attached files.
Show LessI had an old Invention Board (circa 2003), which I'm finally getting back to. However, it didn't ship with drivers for Win7....
Digging around about I found SuiteUSB/CyUSB driver (http://www.cypress.com/?rID=34870), which is a generic USB driver for cypress usb chips.
However, that doesn't ship with config files that will work with the Invention Board. Hacking a bit on the INF files resulted in a working driver and me being able to use the CyConsole (part of the USB suite) connect to the InventionBoard and read stuff, reset it and so on.
All you need is to save the below into a cybus.inf file, and copy the cybus.sys file into the same directory as the inf file. Follow the steps in the Driver/CyUSB.pdf file to install it.
[Version]
Signature="$WINDOWS NT$"
Class=USB
ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
provider=%CYUSB_Provider%
CatalogFile=CYUSB.cat
DriverVer=10/12/2009,3.4.4.00
[SourceDisksNames]
1=%CYUSB_Install%,,,
[SourceDisksFiles]
CYUSB.sys = 1
[DestinationDirs]
CYUSB.Files.Ext = 10,System32\Drivers
MyDevice.Files.Ext = 10,System32\MyDevice
[ControlFlags]
ExcludeFromSelect = *
[Manufacturer]
%CYUSB_Provider%=Device,NT,NTx86,NTamd64
;for all platforms
[Device]
%VID_04B4&PID_F101.DeviceDesc%=MyDevice, USB\VID_04B4&PID_F101
;for windows 2000 non intel platforms
[Device.NT]
%VID_04B4&PID_F101.DeviceDesc%=MyDevice, USB\VID_04B4&PID_F101
%VID_0547&PID_1002.DeviceDesc%=CyUsb, USB\VID_0547&PID_1002
;for x86 platforms
[Device.NTx86]
%VID_04B4&PID_F101.DeviceDesc%=MyDevice, USB\VID_04B4&PID_F101
%VID_0547&PID_1002.DeviceDesc%=CyUsb, USB\VID_0547&PID_1002
;for x64 platforms
[Device.NTamd64]
%VID_04B4&PID_F101.DeviceDesc%=MyDevice, USB\VID_04B4&PID_F101
%VID_0547&PID_1002.DeviceDesc%=CyUsb, USB\VID_0547&PID_1002
[MyDevice]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[MyDevice.HW]
AddReg=MyDevice.AddReg.Guid
[MyDevice.Services]
Addservice = CYUSB,2,CYUSB.AddService
[MyDevice.NT]
CopyFiles=CYUSB.Files.Ext, MyDevice.Files.Ext
AddReg=CyUsb.AddReg
[MyDevice.NT.HW]
AddReg=MyDevice.AddReg.Guid
[MyDevice.NT.Services]
Addservice = CYUSB,2,CYUSB.AddService
[MyDevice.NTx86]
CopyFiles=CYUSB.Files.Ext, MyDevice.Files.Ext
AddReg=CyUsb.AddReg
[MyDevice.NTx86.HW]
AddReg=MyDevice.AddReg.Guid
[MyDevice.NTx86.Services]
Addservice = CYUSB,2,CYUSB.AddService
[MyDevice.NTamd64]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[MyDevice.NTamd64.HW]
AddReg=MyDevice.AddReg.Guid
[MyDevice.NTamd64.Services]
Addservice = CYUSB,2,CYUSB.AddService
[MyDevice.AddReg.Guid]
HKR,,DriverGUID,,%CYUSB.GUID%
HKR,,DriverEXECSCRIPT,,%MyDevice.EXECSCRIPT%
[CYUSB]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.NT]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.NT.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.NT.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.NTx86]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.NTx86.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.NTx86.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.NTamd64]
CopyFiles=CYUSB.Files.Ext
AddReg=CyUsb.AddReg
[CYUSB.NTamd64.HW]
AddReg=CYUSB.AddReg.Guid
[CYUSB.NTamd64.Services]
Addservice = CYUSB,2,CYUSB.AddService
[CYUSB.AddReg]
; Deprecating - do not use in new apps to identify a CYUSB driver
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,CYUSB.sys
; You may optionally include a check for DriverBase in your application to check for a CYUSB driver
HKR,,DriverBase,,CYUSB.sys
HKR,"Parameters","MaximumTransferSize",0x10001,4096
HKR,"Parameters","DebugLevel",0x10001,2
HKR,,FriendlyName,,%CYUSB_Description%
[CYUSB.AddService]
DisplayName = %CYUSB_Description%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\System32\Drivers\CYUSB.sys
AddReg = CYUSB.AddReg
LoadOrderGroup = Base
[CYUSB.Files.Ext]
CYUSB.sys
[CYUSB.AddReg.Guid]
HKR,,DriverGUID,,%CYUSB.GUID%
[Strings]
CYUSB_Provider = "Cypress"
CYUSB_Company = "Cypress Semiconductor Corporation"
CYUSB_Description = "Cypress Generic USB Driver"
CYUSB_DisplayName = "Cypress USB Generic"
CYUSB_Install = "Cypress CYUSB Driver Installation Disk"
%VID_04B4&PID_F101.DeviceDesc="Cypress USB Generic Driver (3.4.4.00)"
CYUSB.GUID="{AE18AA60-7F6A-11d4-97DD-00010229B959}"
CYUSB_Unused = "."
I would like to convert and move 8 bit data in one SRAM buffer into 16 bit data in another SRAM buffer. The data bytes can be twinned, as I will be interpolating using the Digital Filter Block later on.
I have used DMA to move data from SRAM to Peripheral, and Peripheral to SRAM, but early on my attempts to move from SRAM to SRAM did nothing. I'm sure I will figure it out now, since I *have* to. <grin>
I would like to do this at as high a speed as possible. I guess I could DMA into a register and then DMA out of a register; however, PSOC only supports 8 bit registers.
Any suggestions?
Thanks in advance!
Show LessWhen setting the flash protection for a bootloader on a psoc 3 project it's easy to find the bootloader flash start and end from the map file. The map file for a psoc 5 project is not as readable. I'm assuming that the bootloader should be protected from 0000 to the start of the bootloadable same as psoc 3. Where in the map files for bootloader or bootloadable psoc 5 project can I find this? I'm looking for the starting address of flash for the bootloadable so I can set the entire bootloader flash below it to protected.
Show LessHello my name is Felipe and i know the Psoc 1 is a litlle bit obsolet but i think for some case it's ok, anyway i've tried to create a software Pwm, because in my proyect i'm using a PSOC CY8C211223 but it only has 4 digital modules and i need 10 pwm, i'm using this PSOC Model because it's very small, i've configured the timer24 like a source clock for my counter for the cycleduty, the timer create a interrupt every 200Khz, it's working but my CycleDuty doesn't work, it doesn't change in the main routine, i've read some articles and notes application about the timer and i think the problem is the global variables declaration, i declared volatile but nothing. this is my code:
//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
volatile BYTE counter=0;
volatile BYTE Cycleduty=10;
volatile BYTE CycleDutyTemp=0;
#pragma interrupt_handler SoftPwm2
void main(void)
{
M8C_EnableGInt ; // Uncomment this line to enable Global Interrupts
// Insert your main routine code here.
Timer24_Start();
Timer24_EnableInt();
for (;;)
{
for (CycleDutyTemp=0;CycleDutyTemp<100;CycleDutyTemp++)
{
M8C_DisableGInt ;
Cycleduty=CycleDutyTemp;
M8C_EnableGInt ;
}
}
}
void SoftPwm2(void)
{
if(counter<100)
{
counter=counter+1;
}
else
{
counter=0;
}
if(counter<Cycleduty)
PRT0DR=1;
else
PRT0DR=0;
}
i've attached my project with the source code, i hope some one can help me
thanks in advance!
Hi,
I am working on power line communication on CY3274 development board , and wanted to use i2c protocol to communicate with the I/O expander but unable to implement it.The problem is the chip(i.e CY8CPLC20) is unable to generate clock on SCL pin(i.e P1[7]).
Can anyone help me to solve this problem
Regards
Shafi
Show LessIs there a way to read a CAN bus mailbox ID that has been set in the configuration window? I know I can use
CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (ID << 21u));
to write a mailbox ID but I cannot find a way to read the ID in the API or seem to locate where its stored in the generated code. Basically trying to read the ID so that I can then modify it based on external inputs.
Show LessHi,
I'm having a problem getting the bootloader working when compiling under Creator 4.0.
The code has maths functions in and compiles with no bootloader.
As soon as I add the bootloadable errors are throw for each math function in the code.
I've tried adding m to the additional includes in the bootloader project to no avail.
Show LessI got a tip that Cypress PSoC could suit my needs. Now I have a few questions to ask.
I have three signal channels all of which will receive a signal within one millisecond.. All the signals may arrive at the same time, or they may be offset by a maximum of one millisecond. I have to measure time from the first signal to each of the other two. Any of the signals may be the first to arrive.
Measurement resolution should be at least 0.3 microseconds. It's also vital to know in which order the signals arrived. I'm thinking of getting the absolute time of the arrival of each signal so software could then check which was first and calculate the elapsed time. I'm, however, not sure if there is a better way.
I was told that the digital blocks of Cypress PSoC might be a solution. But before I buy any development Kits and such I'd like to have some comments from the experts.
Can this be done with Cypress PSoC?
Should I select PSoC 5 or PSoC 4?
Show LessHi,
I’ve been working on I2C communication between a PSOC 5LP (master) and multiple PSOC 4’s (slaves). This is being done with a Cy8CKIT-059 and multiple Cy8CKIT-049-42xx boards. The goal is to be able to add a slave device to the bus, in a default configuration with address 0x08, and have the master assign it a new address and maintain a list of all currently used slave addresses. The slave stores its address in flash (Emulated EEPROM) so at power up the configuration remains unchanged. For now, the part about having the master store a list of addresses has been set aside and I’m just sending commands through USBUART via a terminal.
Most of this project is functioning correctly, but I’m running into a few hiccups that really come down to error checking. There are also some parts of the code that aren’t exactly elegant, but thus far my goal has been to just get things working, so please excuse them. I have attached a zip with the main.c and main.h for both the master and slave. My questions are:
1. I am using the I2CMasterWriteBuf and I2CMasterReadBuf API functions and they are working well. My problem is that these API functions are returning “SCB_I2C_MSTR_NO_ERROR” when they try to talk to a slave address that does not exist. I am clearly not understanding how the return value of the functions is created and would like to be able to find out if a slave is not on the bus and generate an error.
2. The second concern is regarding sending a save device a command to change its address. I am currently using a simple block check to validate packets, which is working as expected. I would like to find a way to generate some kind of acknowledgement from a slave saying that the incoming packet is valid before executing its address change. This way the master knows the packet was received correctly and can update its slave address array accordingly.
As of now if the block check isn’t correct the slave will not attempt to update its address, but the master has no way of knowing that this did not happen. The only way I can do this right now is to attempt to read from the new slave address and see if the correct status value is returned, indicating a successful address change, though if the address isn’t there I run into the previous problem. This can be worked around by checking that the status in the returned packet is correct, but it feels a bit like going around my elbow to get to my rear and, frankly, I don’t really like it.
I’m currently using the MasterWriteBuf and MasterReadBuf functions with the mode set to “MODE_COMPLETE_XFER” which I have a hunch is part of the problem. I feel like I need to use the “MODE_NO_STOP” mode, but I don’t understand how this works and can’t seem to get things working with it.
I’m new to Cypress devices as well as I2C. Any help with understanding where my logic is incorrect or guidance to a solution would be greatly appreciated. If anything isn’t clear I’ll be happy to try and resolve any ambiguity.
Thanks,
Matthew
Show Less