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

USBUART PSOC

$
0
0

Is there an example circuit with a PSOC 5 to show how to connect the PSOC for USBUART?

I'm looking for a schematic of the connection between the PSOC and the USB connector with the D+ and D- signals.

From my understanding of the USBUART module is that it uses the physical USB layer to transmit the data over D+ and D- connections and then when connected to a host PC the PC recognizes the PSOC as a Virtual COM port, is this correct?

Does the USB support BUS power in this configuration? If so what is the max Current that can be supplied? I'm assuming it's 500mA is that correct?

I've already found these documents:

http://www.cypress.com/file/53431/download

This document shows the software side of the implementation. It points to this development kit. CY8CKIT-001.

When I look up the schematic for the PSOC 5 version I find this:

http://www.cypress.com/documentation/development-kitsboards/cy8ckit-001-...

I've uploaded both the schematic and a small clip of the schematic that highlights the USB connections made for the demo board. In the clip of the schematic is the highlighted chassis ground is that symbol there for a reason? Is it just symbolic of the chassis of the USB connector shield it doesn't show that it isn't connected to anything else in the rest of the schematic.

This is a loaded question I know, and I don't know if I posted it in the right place on here. Please let me know if it is in the wrong place and I'll move it to a more appropriate place.

Thanks in advance for the help.

 


PSoC5LP - Multiple USB devices on single USBFS component?

$
0
0

Hi all,

I have some questions about USB functionality on a PSoC5LP.  The project I'm working on requires multiple USB devices on a single USB connection.  Namely, both a USB HID (keypad) and a USB UART.  I have gotten both of these components working separately (I.E. in different projects) but I can't seem to figure out how to run both these devices at the same time on the same USBFS component.  For the USB UART, I used the descriptor template USBUART_TwoComPorts.root.xml (came with PSoC Creator) and deleted the second COM port from the descriptor (CDC Interface 3 and 4), as I only need one of the COM ports.  This works on its own, and I can take data in and echo it back to the virtual COM port as seen from my PC.  However I can't seem to get it working in conjunction with a USB HID in the same component.

I imagine there are rules to running multiple devices on this single USBFS component, I'm just not aware of them.
I'm currently starting USB up as follows:

uint8 Keyboard_Data[8] = {0,0,0,0,0,0,0,0};
USBFS_1_Start(0,USBFS_1_DWR_VDDD_OPERATION);  //Start up the USB HID Keypad    
USBFS_1_EnableOutEP(2);
USBFS_1_Start(1,USBFS_1_DWR_VDDD_OPERATION);  //Start up the USB UART
while(!USBFS_1_bGetConfiguration());
USBFS_1_LoadInEP(1, Keyboard_Data, 8);
USBFS_1_CDC_Init();

I then call the following periodically to send keyboard data:

if(USBFS_1_bGetEPAckState(1)) {
    USBFS_1_LoadInEP(1, Keyboard_Data, 8);
    while(!USBFS_1_bGetEPAckState(1));
}

I also call a periodic function to take in CDC data and echo it back:

    if (USBFS_1_DataIsReady()){
        count = USBFS_1_GetAll(USB_Buffer);     /*MAX 64 BYTES PER SPEC*/
        if (count != 0){
            /*We have data*/   
            /*Wait until ready to send data*/
            while (!USBFS_1_CDCIsReady());
            /*Echo it back*/
            USBFS_1_PutData(USB_Buffer,count);
            /*If we are at max buffer size, append a NULL to assure PC identifies end of data*/
            if (count == MAX_USBUART_BUFFSIZE){
                while (!USBFS_1_CDCIsReady());
                USBFS_1_PutData(NULL,0);
            }
        }
    }

Where I run into problems is when I attempt to add a USB UART.

My question is, in what way should I be configuring/starting the devices up as to have the USB UART function at the same time as the HID Keypad?  What considerations do I need to have in mind so that the devices play nice with each other?  I'm very new to using PSoC and USB so it's possible it's something very obvious that I'm just not familiar with.

Any advice would be greatly appreciated.

Thanks!

 

UDB Editor parameterize datapath width

$
0
0

Hi guys,

I have build a new component with the UDB Editor. Now I try to parameterize the data path width. 

With varilog this can be done through defining a hardware parameter and separate the code with a if else construct.

But for simplicity I'd like to use the UDB Editor and with this graphical tool I do not find a solution for the problem.

Please Help!

 

 

 

HSV WS2812 backlight

$
0
0

Hello,

I am working on a nixie clock. For backlight I have used Adafruit's Neopixel digital LEDs(based on WS2812). My idea is that color of nixie tube's backlight will reflect which part of minute/hour/day it is. I have taken WS2812 component from somewhere on this forum, and written the code. Also, I did not write color space conversion myself, but I have rewritten some code found on the internet.

The problem is that at 54th second the color does not change as expected, but immediately changes to something like red.

To better diagnose the error, I have rewritten the code to C# Windows Forms appplication. In this form, the code, which is to my knowledge the same, does work as expected.

Can someone take a look at my code, and help me find the difference? I think the difference is not in the code itself, but in the architecture;,but I do not know so much about MCUs.

Thank you,

Stanislav Husár

i2C to analog 0-10V output

$
0
0

Hello,

I bought an i2C interface module to output an analog 0-10 V to four channels. This module receives i2C commands to set the values (0 - 1023) for each (0-3) channel. Here is a link to the module; http://www.horter.de/blog/i2c-analog-output-4-kanaele-10-bit/

To test the module, I am using the code in the attached 'main' file. However, this does not result in the output of the module changing values. To confirm the module is working, I tested it with an simple Arduino Uno, and everything seems to be working just fine. On the site of the manufacturer of the module, it is stated that an odd number of bytes should be sent, the first one indicating the channel which will be addressed, the second and the third one containing the LSB and MSB of the value to be set.

Can anybody help me on my way on what I'm missing here?

Thanks in advance

 

 

Attachments: 

SAR ADC data write(send) to the port (GPIO) of the psoc 059lp board

$
0
0

Dear All

Please help me to write the code for the given requirement.

I want to send the ADC data to the port. I want 500k data to read the ADC and write to the port by using 12 bit SAR ADC of PSOC059lp

 

USB_UART to multiple UARTs

$
0
0

I'm working on an application that requires control of multiple devices from a single USB_UART/hyperterminal connection.

My solution was to use the CY8C5888 devices used on the CY8CKIT-059 as it has worked in a similar prototype application.  

I've designed a custom board that uses three (3) CY8C5888LTI-LP097 PSOCs.  One PSOC uses the USB_UART component to interface to a PC to allow hyperterminal control of two switches to turn on supply voltage to the other two separate PSOC devices.  Once powered, these secondary devices may then be used to communicate via UART to the main USB_UART device.  I decided to play with the MUX components and just use a single UART whose external connections are selected based on hyperterminal commands.  When sending UART commands to the secondary devices, they are programmed to reply with an acknowledgement message. 

So far, the main USB_UART controller device appears to be working well for just hyperterminal communications back to the PC.  The UART/MUX switch part seems to work fine, and enabling power to the other two PSOC devices works ok as well.  However, when I try to talk to the other devices over UART, I get mixed results.  Mostly, I am getting incomplete messages and/or the acknowledgement messages from the remote devices seem to be delayed by 1 message.  

I'm sure there is something I'm doing wrong either with buffer sizes, or how I'm reading the UART messages back from the secondary PSOC devices, or something else.  Since I will ultimately need to send and receive more than 4 bytes at a time I have been setting the UART TX and RX buffers to numbers greater than 4 which I have read generates an internal interrupt, which is hopefully being handled by the while (UART_GetRxBufferSize() ) loop... My concern is that there is another USB_UART device that is also generating interrupts that I might not be handling correctly.   

For completeness, I've had something similar to this working with just the CY8CKIT-059... where the kitprog device was ONLY relaying hyperterminal commands to the single CY8C5888 target device over UART and it seemed to work ok.. with the target sending full messages back as expected.  Right now, I'm just turning LEDs on and off via GPIO on the secondary PSOC devices... which is currently working. Since that part worked, I strongly suspect that my "problem" code is on the USB_UART side.  I've read through the UART data sheet as well as the following forum posts, but am still a bit confused how to get this working correctly.    

http://www.cypress.com/forum/psoc-creator-software/char-int

http://www.cypress.com/forum/psoc-creator-software/uart-buffer

http://www.cypress.com/forum/psoc-5-device-programming/issue-implementin...

 

I'm uploading the project for the USB_UART side in hopes that someone can shed some light on what I might be doing wrong.

Thanks in advance.

 

AMuxHW: Problems with sheet connector

$
0
0

Hi, I am trying to use a 20 port analog multiplexer. It has an input AMuxHW_1 which is 5 bits wide.

In EP64560 on page 2 I see how 2 outputs of a lookup table are combined into 1 sheet connector that is then 2 bits wide, and then another instance of this sheet connector is connected to the AMuxHW input of a 3 port Amux.

I have 2 problems:

1) How can I tell the sheet connector how many bits it is wide? When I connect 2 outputs of a control register to a sheet connector, they are connected to each other, and my sheet connector is still 1 bit wide.

2) I understand that I need the sheet connector twice, once in the place where the 5 bits are combined into one bus and once at the AMuxHW where I need a bus to control the switching. How can I "invoke" the sheet connector again? How can I give it a name?


UART-DMA and Break

$
0
0

Hello Forum,

i have made an 4 Channel-DMX Receiver with the PSoc5 Kit and it works fine with Interrupt based Code:

CY_ISR(ISR_DMX1)
{
    // Check for break
    if((UART_1_ReadRxStatus() & UART_1_RX_STS_BREAK) != 0)
    {
        DMX1Pointer = 0;
    }
    else //Read the Byte and store it in the Array
    {
        DMXIn1[DMX1Pointer] = UART_1_ReadRxData();
        DMX1Pointer++;
    }
}

Now i want to do this with DMA. I think there is no Problem to store the Bytes, but how do i reset the Stream when a Break of the UART is detected?

Günter

I2C Materwritebuf not working inside a function

$
0
0

Hello,

I have the following piece of code which is working fine on the main thread

uint8 MOTOR_bufsize=3
uint8 xSpeedLSB = value & 0xff;
uint8 xSpeedMSB = value >> 8;
uint8 MOTOR_waarde[3] = {0x0, xSpeedLSB, xSpeedMSB};
//set MOTOR
I2C_MOTOR_MasterClearStatus(); /* Clear any previous status */
I2C_MOTOR_MasterWriteBuf(MOTOR_I2C_SLAVEADRES, MOTOR_waarde, MOTOR_bufsize, I2C_MOTOR_MODE_COMPLETE_XFER);

But as soon I put the same lines into a function, nothing happens when the function is called. The function is shown below;

void set_speed(axis, speed) {
if (axis == Xaxis) {
  uint8 channel = 0x0;
  }
uint8 bufsize=3;
uint8 SpeedLSB = speed & 0xff;
uint8 SpeedMSB = speed >> 8;
uint8 MOTOR_waarde[3] = {channel, SpeedLSB, SpeedMSB};
I2C_MOTOR_MasterClearStatus(); /* Clear any previous status */
I2C_MOTOR_MasterWriteBuf(MOTOR_I2C_SLAVEADRES, MOTOR_waarde, bufsize, I2C_MOTOR_MODE_COMPLETE_XFER);
}

the function is called by:

set_speed(Xaxis, value);

in which Xaxis is an integer (0) and value is an integer between 0 and 1023.

The function is initialized by:

void set_speed(int axis, int speed);

Can anybody help me on my way why my function does not work?

Command Storage

$
0
0

Hello,

I am writing a program that takes command strings off a UART bluetooth module (see attached). I have the parser working and initially thought I would only have a handful of commands. I am now finding out I will need many more commands.

I have it setup currently in an inefficient manner, a way that make it difficult to add additional commands. I will be re-writing the main c program to scan an array of commands that I wish to define in the header.

What is the best method to store a long list of character strings in a header so I do not have to use the #define specifier over and over, then redefine them in an array?

Thanks

Connecting SWDIO/SWDCLK to multiple devices

$
0
0

I have two PSOC devices on a single board and I would ideally like to have a single programming connector that I can use to program either device.  I'm wondering if it would be sufficient to switch XRES (via jumper) to the device I would like to program and connect SWDIO/SWDCLK to both devices. 

Project with DHT22 or RHT03

$
0
0

Hello people I'm starting a project with dht22 or rht03 but I do not find much information, just with dht11, help me with some example with psoc 4 or 5 or some library for this sensor

thank you very much :)
 

Project with DHT22 or RHT03

$
0
0

Hello people I'm starting a project with dht22 or rht03 but I do not find much information, just with dht11, help me with some example or library for psoc 4 or 5.

thank you :) 

needed help on DMA project

$
0
0

Hello,

I am trying to do a filtering process on psoc5. I did lots of thing but with small issue I turn back the basic form of the project. I tried to solve problem myself but I couldn't understand the reason of the problem. 

Here I am doing with ping pong dma and send datas to sd card with emfile. When I writing the datas to sdcard I am writing an array after that I am doing a shift operation (just for try to solve problem. I will use the results after.)  Like this code. 

if(TD_Num==DMA_FilterToAvgFilter_TD[1]){
                FS_Write(pFile, (uint8*)filteredDataP0, (NO_OF_SAMPLES*2));
                for(c=0;c<NO_OF_SAMPLES;c++){
                    filteredDataP0[c] = filteredDataP0[c] >> 7;
 }

But in graph (you can see in attachments) , I wouldn't think to see shift operation results. But there are. 

Firstly, I thought about the clear the isr flag, but it seems clearly that clear isr isn't needed.

Do you have any idea about the this problem.

Regards

Burak 


Timer Enable not Occuring

$
0
0

Good day to you all,

 

I am fairly new to psoc and am currently working on a precursor to another project. The system is meant to work as follows;

Two pwm's are to generate a single short pulse "start" and "stop" respectively and these are to be sent to a coarse counter (I used a timer in this case) and the timer is meant to count the period between the start and stop signal (hence I used a logic 'xor' for the enable) and generate an interrupt which prints the output through the uart. But for some reason I get nothing at the output.

 

I have already tested the uart to confirm it works separately. And I have also confirmed the appropriate pulses are being generated by the pwm's with an oscilloscope so I am at a loss as to why the enable condition is not being met. I have attached the project to this post in hopes that someone can give me clarity as to what the problem could be.

 

p.s. In case you wonder where the interrupt definition is, it is in the isr_1.c page under the CY_ISR function.

 

Reference Voltage

$
0
0

I am using 4 opamp for the design of filter and ADC

I want an reference voltage in PSoC to drive the external circuit and as well as ADC.

What are the possible ways to do it?

Can do it using MUX or PGA or any other way?

Regards,

Umama Shireen

Reading PSoC Programming FLASH

$
0
0

Hi

I wanted know,

1. Is there is a way to read the PSOC Programm Flash (which is upto 256K in PSOC-5 devices) in which the compiled program is stored. Also how to know the end of programm.

2. Can I assign any ISR a fixed location in Flash.

3. Can an  ISR or function be loaded for the main program as a separately compiled PSoC project.

 

Regards

Ajay

 

 

 

 

Dummy connectors in design

Measure 40 high impedance analog signals with ADC_SAR

$
0
0

Hi all,

At a test stand we have 40 analog signals coming from voltage dividers.

The problem is that the resistances are very high. The variable resistor, connected to 24VDC, is about 10MOhm, the resistor over that the voltage is measured is 1MOhm.

I have verified by using PSoC Creator that I can configure a CY8C5868AXI-LP035 so that its ADC_SAR has 40 single ended inputs.

The signals change very slowly (temperatures). The measurement may be slow, 100ms or less per channel are ok.

However, I am not sure about the input resistance of the ADC_SAR. There is a very low current flowing through the voltage divider, about 2µA. If the input resistance of ADC_SAR is not extremely high, the input resistance will introduce an error and reduce the measured voltage significantly.

1) What is the input resistance? Can it considered to be constant so that the error introduced by this resistance can be calculated?

We could use OpAmps as impedance converter / voltage follower (I am German and am not sure if this is correct in English; in German it is "Impedanzwandler" and "Spannungsfolger"), but then we would need 40 of them (I know there are ICs with 8 OpAmps).

2) The PSoC5 has 4 OpAmps on board.  Can they be used as impedance converters / voltage followers between the multiplexer part of the ADC_SAR and the ADC part?

Thanks for input,

Turtle
 

Viewing all 387 articles
Browse latest View live


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