Quantcast
Channel: Cypress Semiconductor - PSoC 5 Device Programming
Viewing all 387 articles
Browse latest View live

SPI Slave MISO at Beginning and End

$
0
0

Hello All,

I have a design using an SPI slave (PSoC 3/5) with the following parameters:

  • CPHA=0, CPOL=1
  • MSB First
  • No data being received (MOSI is zero constant)
  • 8-bits wide
  • 4 Byte FIFO
  • External Clock (24 MHz BUS_CLK)

The application requires that, while SCLK is in its idle state, MISO be a steady high to indicate that the device is ready for a data transfer.  Immediately after the last SCLK, the MISO must go low to indicate that the device is not yet ready for another transfer.  Once the device is ready, the MISO will go high.  I can add logic to the SPIS to force these conditions, but before I do that, I think I should better understand the SPI slave.

I will only transfer 4 bytes at a time.  And, since the clock is much faster than SCLK, I consider a delay of a few clock cycles to be essentially instantaneous.  I don't want to use the SS input, but if I have to, I'll use internal signals to "fake it out".  That being said, I want to determine/control the MISO state before and after the transfer.

Assume that the FIFO is full and I have written directly to the shift register using SPIS_WriteTxData() before the first leading (falling) SCLK edge.  What is the MISO state?  Is it equal to the MSb of the first byte, already in the shift register?

Also, what would the MISO state be after the trailing (rising) edge of SCLK?  Would it be the LSb of the final byte, the MSb of the next byte from the FIFO, or something else?

Any help would be appreciated.

Paul


RTC Example 5LP kit 059

$
0
0

Hi,

First timer here so please forgive my simple questions as new to C and Cypress, though have done a little C++ with Arduino.

Been working though the tutorials etc and have the RTC 5LP example running ok.

The first point, though cannot see anything in the RTC datasheet, wondered if  there is any way the RTC can be programmed with the current time/date automatically  taken from host PC at programming time ? a very handy feature found on the Arduino.

The other point is about my lack of C knowledge

Was amending the RTC main.c code to display on the LCD in different layouts etc, but then found that some changes had been totally ignored.

Found the cause to be that the same code was replicated in the RtcIntHandler.c and that was overriding the changes I made in main.c

So does C demand you duplicate code like this ? or was the code put in the main.c  as well,  just to make things clearer for the newbie  to see hows it was done ?

thanks

 

part of the code in both main.c   ---

    /* Print current time */
    tmpVar = RTC_ReadSecond();
    PrintDecNumber(tmpVar, 0u, 11u);  etc etc

 

and RtcIntHandler.c

void RTC_EverySecondHandler_Callback(void)
{
    /* Get and print current seconds */
    temp = RTC_ReadSecond();        
    PrintDecNumber(temp, 0u, 11u);
    
    /* Get status */
    temp = RTC_ReadStatus();  etc etc
  

 

 

 

DMA transfer from digital peripheral pin

$
0
0

Hi all,

I do have a (most likely) trivial question for you guys :

I need to catch data from a microprocessor bus and hence I want to utilize DMA transfers in order to address the latency requirements.

The input for the microprocessor bus is realized with 8 digital pins (with  contiguous setup)  and the question is how to supply the source address (pointer) to CyDmaTdSetAddress ?

We have :

DMA1_DmaInitialize(DMA_BYTES_PER_BURST, DMA_REQUEST_PER_BURST, 
                                    HI16(DMA_SRC_BASE), HI16(DMA_DST_BASE));

In there DMA_SRC_BASE is defined as CYDEV_PERIPH_BASE and DMA_DST_BASE as CYDEV_SRAM_BASE

What I am missing is the correct source address setup for :

CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)DTA__PS), LO16((uint32)da));

( da is the receiving char array ... no problem with that)

DTA is the group of digital input pins and the the header file suggest that DTA__PS will give me the address of the pin state register 

/* Main Port Registers */
/* Pin State */
#define DTA_PS                     (* (reg8 *) DTA__PS)

But this doesn't seem to work.

Any suggestions ?

 

Thanks in advance, regards Achim

PSoC 5 Reset Troubleshooting

$
0
0

Hi,

We're having trouble with a PSoC 5 based application apparently resetting under certain conditions.  The reset happens and is recovered from very quickly and we haven't been unable to determine the "chicken and egg" - did the PSoC somehow cause the reset or did something else the PSoC to reset e.g. brown out.

Looking around the forum and web there seems to be a function that should allow us to retrieve the cause of the last low voltage reset which would maybe give us a clue as to what is happening -  CySysLvdGetInterruptSource() which is part of the cv_Boot component.

The only reference I can find to this function anywhere is in relation to the PSoC 4.  Is it possible to use this or something similar on the PS0C 5 and, if so, could anybody point me in the right direction to find it and impliment it?

Many thanks.

Analog high-pass filter using PSoC OpAmp

$
0
0

Hi,

I'm trying to do some processing of the analog signal on the PSoC 5LP. The problem is that the signal has rather high 50 Hz mains hum superimposed, and it even exceeds the input range of PSoC opamps and other analog components. Also, since the relevant signal is small compared to the hum, digital filtering is not very useful. I would like to use some kind of an analog filter using PSoC opamps (eg. high pass with cutoff above 100Hz), but I'm not sure how to do the biasing, since PSoC opamps are single supply.

How should the biasing for the high pass analog filter be done?

KitProg and CY8CKIT-001

$
0
0

Assuming one makes an appropriate adapter cable, is it possible to program the CY8C38 and CY8C58 family processor modules in the CY8CKIT-001 using the KitProg that comes with the CY8CKIT-059?

Paul

Programming PSoC5 LP from python

$
0
0

Hi,

I am trying to program PSoC 5LP from python.

I am on Windows 10 Pro, 64 bit. I am using python 3.4.4, and PSoC 5LP kit, connected via kit prog to PC. I am able to program the device using PSoC creator 4.0, update 1.

I tried to program the device using "C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\Python_Ex\Python_Ex.py"

I modified this script to point to my hex file. 

However, I am getting this error below:

-------------------------------------------

C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\Python_Ex>python Python_Ex.py
  File "Python_Ex.py", line 418
    print "Mismatch of Checksum: Expected 0x%x, Got 0x%x" %(flashChecksum, hexChecksum)
                                                        ^
SyntaxError: invalid syntax

-------------------------------------------

Also, if multiple PSoCs are connected to the same PC (via kit prog), how will I program them all, one by one?

Regards,

Vishnu

 

 

Quick question: Waiting SPI Status Done

$
0
0

Hi,

Is it a good practice to add timeout while waiting SPI Status done after spi_write or is it something highly unlikely to occur?

while(!(SPIM_1_ReadTxStatus() & SPIM_1_STS_SPI_DONE));

Best,

Nico


USBUART on Windows 10

$
0
0

Hi ,

I have several questions on this topic. 

1. When I use my device plugged directly to the PC, Windows 10 "Creators Update" uses its own usbser.sys. It looks like no Cypress driver is needed as the communication appears to work fine. Is this correct ?

2. Even though it seems to work, I have no "eject" symbol in windows where I can disconnect logically. Is this not needed or a driver fault ?

3. For my project I need to connect the device at a remote location via LAN. Hence I need a solution e.g. with a USB Network Server. Do you have experience with USBUART on an USB Network Server (LAN to USB Hub) ? Any idea is highly appreciated at this point.

4. When does USBUART_1_GetConfiguration() return a non-zero value, as soon as it is enlisted in the device manager of windows ? I would appreciate more information on this call to be able to monitor USB states better. E.g. I need to identify events where the device is disconnected logically from i.e. the USB Network Server.

Thank you very much in advance
Stefan

I2C_MasterReadBuf and related

$
0
0

I am trying to understand more about I2C and the use of it in PSoC.

At this moment i am working with a MPU-6050. There is a library for this component and it works all fine. 

But..... its to easy for me to just use a library, copy/past it and ready. 

At the moment i have code that works with the I2C_MasterReadByte() function. 

Is there a way to use the I2C_MasterReadBuf() function?

And is there a way to shorten this piece of code?

Best Regards,

Frank

 

 

Attachments: 

Maximum PWM clock speed for PSoC-5

$
0
0

Hi!

Till date I have been programming PSoC-4 and the maximum PWM clock speed is limited to half of  system clock. i,e, 48/2 = 24MHz.

Now I am wanting to try out PSoC-5. I just built a project with a PWM block feeding from a 78MHz clock. It compiled without errors.

Another thing I don't understand is that even when I change the clock speed to say 500MHz, there is no error but only a warning that the clock speed is outside tolerance.

I also 'loosely'  recall that even for PSOC-5 the maximum PWM speed is half of the system clock speed.

My question is: What is the maximum permitted speed for PWM in PSOC-5?

Thanks

DAC, need a sin with the max frequency be shown

$
0
0

Hey, im not so good in this thing, so sorry for, maybe, such a stupid question..

i need to get sin signal with max possible frequency for DAC.

How can i know max possible for DAC?

if i correctly understand this - i need to have a function in couter to incrise x from time with high-high frequency and in main call DAC8_WriteStall(sin(x)); where x have really small step, so i can see on the Oscilloscope max possible frequency?

Thanks

Read USB keyboard

$
0
0

Hello everyone,

I have absolutely no idea how to transfer data from external USB keyboard, I've searched the net and nothing. I tried USBFS, but then I realized it's for emulating USB devices.

Is there any way I can get data from external USB keyboard to PSOC 5LP? The keyboard must be connected to USB port.

Thanks in advance,

Lidia

Bootloader time out

$
0
0

I'm having a problem with bootloading via a UART connected to wifi.

 

Everything was previously working, now with no change to the coms set up I am getting a consistent time out message in the host app when I attempt to upload new firmware.

The first command works fine.

The second command sent by the host is a request for the size of flash. The fist byte of the reply is returned and then nothing further.

 

We have made hardware decision based on being able to flash over wifi and its urgent we get it working again (have raised a ticket, they suggested opening a question here)

9 data bit UART

$
0
0

Hey,
I'd like to receive using UART data with a start bit stop bit and 9 data bits,
Using the mark/space option I can detect 9 data bits but I'm having troubles finding out whether the mark/space is high or low.
How can I detect the mark/space bit?


Using PSoC 4 as BLE for PSoC 5LP

$
0
0

Hi all

 

I am developing a new board and from previous experience punting for the 5LP over the 4, due to resources, even though I need the BLE. Has anyone used the 4 as a BLE transceiver for a 5LP and also utilize the other resources of the 4? What issues might there be in relation to programming each chip in relation to a production board?

 

Regards

Read user switch on the PSOC5LP prototyping stick?

EZI2C slave mode example/snippets?

$
0
0

I'm using PSOC creator 4.0SP1. The docs seem to show 2 completely different APIs for the I2C blocks.

Does anyone have a canonical snippet for the EZI2C part which shows how to check for, and then read, content sent from master?

I'm at a loss to find the equivalents of the I2C_SlaveXXX() functions, especially those which deal with buffered data counts and the like.

TAIA.

Seeking USB Mass Storage Class Developer

$
0
0

I am seeking a PSOC experienced developer to implement Mass Storage Class within the existing Cypress USB framework.  Basically, implement the SCSI command set. LIBOPENCM3 and STM32PLUS libraries have reference implementations to start with.  If you are interested, please reach out to me via email.

Raul Segredo
segredo@avionica.com

Problem with exporting PSoC Creator4.0 project to Eclipse Neon

$
0
0

I have a problem with exporting PSoC Creator4.0 project to Eclipse Neon.

Version of  software is

Eclipse:4.6.2

PSoC Creator:4.0.0.432

 

I installed PSoCCreatorEclipse_Import_v2.3.1.zip, then exported PSoC Creator Project for eclipse.

Then, created new C project in eclipse with PSoC Creator Project directory, as shown in PSoC Creator Help.

At the step of set Cross GCC Command, I set PSoC Creator arm tools as PSoC Creator Help say, but button "Next" and "Finish" are disabled(gray outed).

When I tried same sequence in eclipse Mars2, It was successful.

 

Is Eclipse Neon out of support yet?

Viewing all 387 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>