PSoC™ 5, 3 & 1 Forum Discussions
Hey,
I am new with PSOC so please bare with me. I tried to find an answer by myself but so far I am not able to. I come from embedded C and ARM Cortex-M background with extensive experience.
I was exploring PSOC for a new project, what I want to do is to control the route of some digital signals. The board will have 2 connectors, and I want to route signals from one connector to the other based on user's configuration. The user will connect signals to some GPIO pins, using PSOC I want to re-route these signals to other GPIO pins. Prior to user configuration I do not know which Pin will be connected to which and whether the signal is input or output. To rephrase, there is a data bus connected to some pins; using the PSOC I want to reroute these signals to other pins. The problem is I cannot make this decision while using the PSOC creator, it needs to be done in the field.
Example:
In the field the user will decide to connect J1.1 to J2.3, later he will decide to connect J1.1 to J2.4 etc... The user can be asked to select if the signal is input or output in the field.
- Is it possible to control the hardware blocks using the C code instead of the PSOC creator schematic ? e.g connect P0[3] to P0[5] using C instead of schematic design
- Is there a way to implement the above using control registers and other blocks?
I tried to use back to back mux with bidirectional pins but at build time I get the below errors.
Thank you for any help
Show LessI have an i/o pin of the PSOC 5LP connected to a microcontroller output pin:
1. Imagine that I want to set the pin of the PSOC as if it was "physically" disconnected to the microcontroller output pin. What would be the best way configuration for the PSOC pin?
2. And in case I want to prevent a shortcut when configuring by mistake the PSOC5 pin as output (with potentially different voltage than the microcontroller output pin), what could be done to prevent damage? I was thinking in using 200ohm resistor in between the pins instead of a direct connection, but this could have some disadvantages like a limitation of the speed, right? any better ideas?
Thanks in advance
Show LessI have a simple program to write some data using a UART and a DAC with a PSOC5. They both work but I see the digital data on the analog pin. I am using P0.0 for the DAC abd P0.1 for UART data. I see the noise on my Salea Logic analyzer and my Techtronics scope.
Any idea what may be wrong?
Show Less
Hello,
I would like to be able to permanently store data to flash of my PSoC5 processor and being able to retrieve it after rebooting the processor. I found sample project "Flash Example" that seems to be doing just that.
This is the code snippet how they store data to flash:
...
CySetTemp();
returnValue = CyWriteRowData(ARRAY_ID, ARRAY_ID_ROW_ADDR, rowPattern);
/* Check if operration is successful */
if (returnValue != CYRET_SUCCESS)
{
LED_Error_Write(LIGHT_ON);
CyHalt(0x00u);
...
It writes data to the flash and then immediately reads it and matches to what was stored. Everything works fine here. But if I modify this code such that when it runs first time it ONLY writes the data and the second it ONLY reads the data then the stored data is lost. So it looks like the stored data didn't survive the reboot OR reprogramming of the chip (I had to do it to comment out the code that writes data to flash).
Is there a way to burn something to flash so it stays there until explicitly erased?
Thanks!
Nikolay
Show LessHello. We have an existing design from ~10 years ago, using a CY8C27443 SO28. We're looking to see if it's possible to update this part to a new ARM based part, in the same footprint so as to not have to re-spin the board.
I fumbled through the product selector, but can't figure a way to look for pin compatible parts. Thanks
Show LessHello,
I'm trying to build a UDB datapath component which measures the time between pulses, with the intention being to DMA the resulting byte stream into RAM. I've built a state machine and set up, hopefully, the appropriate set of instructions. However, it looks like data never gets written to my FIFO --- the 'F0 bus status (not empty)' signal never gets asserted.
Questions:
- there appears to be no way for an ALU operation to write to a FIFO. So, instead I add a datapath input for 'Load F0 with A0' which tests the FSM state. (And as far as I can tell this input does seem to be getting asserted.) This seems very contorted. Is there a better way?
- are there any application notes describing how to set up output DMA for a datapath component? It's not simple, and there are a lot of subtleties in getting the maximum possible throughput.
- is there a simulator or debugger or some way to observe the internal state of the component? Right now I have absolutely no idea whether my state machine even works!
The full project's attached if anyone really cares to look --- the component is UdbSampler and it's on the 'Capture' page of the schematic.
Thanks!
(In the picture below, fifoready is being exported as the component's drq; and push is defined as (FSM == ROLLOVER_STATE) || (FSM == PULSE_STATE).)
Show Less
I am a bit confused regarding use of the flags when sending SPI data and seem to get back wrong data from my device
I have a SPIM component set up and started and can see activity on CS, Miso, Mosi and Sck but get wrong data back.
Is my code below correct to send a command byte (read command and register ID) and then read back the expected bytes?
Header length is number of command bytes and header buffer is buffer passed to routine containing command bytes.
readlenth is number of bytes to read and they are passed back in readBuffer.
int readfromspi(uint16 headerLength, const uint8 *headerBuffer, uint32 readlength, uint8 *readBuffer)
{
CS_Write(0);
for(i=0; i<headerLength; i++)
{
SPIM_WriteTxData(headerBuffer);
while(!(SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)){};
readBuffer[0] = SPIM_ReadRxData() ; // Dummy read as we write the header
}
for(i=0; i<(int)readlength; i++)
{
SPIM_WriteTxData(0x00); //dummy write
while(!(SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)){};
readBuffer = SPIM_ReadRxData() ; // SPI_receive_data
}
CS_Write(1);
return 0;
}
Show LessHi. I am trying to interconnect the psoc5lp with the tdc gp22 module (time to digital converter) to measure time differences between two signals.
A spi communication test must be performed to verify the correct operation of the gp22.
First, I must configure the 7 configuration registers (from 0 to 6). Then according to the data sheet, to carry out the test, an address must be sent (0xB5) and the gp22 must return the MSB of the register 1. In our case, MSB = 0x21
The problem is that I get different values in each cycle of the loop, which indicates that it is not working correctly. Could you help me determine if the problem is in the code or in the configuration of the spi module?
I enclose the workspace bundle, the data sheet and a application note of gp22.
Thank you
Rodrigo
Show LessDear Sirs,
I'm facing some problems with a device I've designed based on PSoC5 implementing a USB HID mouse in particular:
initial condition is with the host PC off and with the mouse already connected into an USB port, then when the PC is powered on at the startup of the Operating System (Red Hat 7 Update 1) the mouse doesn't work, the pointer isn't moving on the screen when the user try to.
The device is present in the connected peripherals, but doesn't not send "events".
If the device is disconnected and reconnected to a USB port with the PC switched on then it is operative and it works. This same behavior has also been verified with the Windows operating system.
Moreover although it is recognized at runtime (thus connecting it to the PC already on), under the graphics interface (X) of Red Hat 7 Update 1 there is no movement but only the left button seems to work. Instead, under Windows, the device is seen as a mouse and it works ok.
The device descriptor is based on CE195394 - USB HID Mouse with PSoC 3/ PSoC 5LP with the remote wakeup enabled.
Can you please provide me some information to solve this issue?
Best Regards
Show LessIs there a maximum trace length for the JTAG wires when connected to a PSoC 5LP?
I've done some research and I found some sites that say the limit is 3" and other sites that say there's no practical limit.
Show Less