You are here

PSOC with USBUART and Win7 x64 | Cypress

PSOC with USBUART and Win7 x64

Summary: 17 Replies, Latest post by danaaknight on 09 Dec 2013 05:41 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
t.schmid's picture
User
18 posts

Dear all,

I am trying to install the USBUART driver of my PSOC project under a Win7 x64 system.

Unfortunatly the generated .inf file isn't recognized by Windows..

Anyone has a clue?

Thanks, Thomas

t.schmid's picture
User
18 posts

I also tried a Win7 32bit version with the same result...

t.schmid's picture
User
18 posts

I solved it!

There was a problem with the code on the PSOC. I enabled the Global Interupts too late.

Sorry for this stupid question :)

 

U2
uday's picture
Cypress Employee
569 posts

Ha, thats a common mistake many people do in the beginning. And it is not quite apparent. Even if the Global Interrupt is enabled after USBFS_Start() the code will still work. But the enumeration process will begin once you enable the global interrupt. But if you are waiting for enmureation to be complete(or for a valid configuration to be assigned), you might get stuck there forever.

 

Bastianpoto's picture
User
6 posts

 Hi,

I encounter the same problem now, where do  I have to put the Enable Gloabal Interrupts?

#include <device.h>

#include "stdio.h"

 

//Defines

#define CLEAR_SCREEN        0x0C

#define CONVERT_TO_ASCII    0x30u

#define BUFFER_LEN   64u

#define ADC_Config_2V 2

#define ADC_Config_3V 1

#define Restart_ADC 1

#define STX 2

#define ETX 3

#define ACK 6

#define SPACE               0x20

#define PRINT_TORQUE        0

#define PRINT_ADC           1

 

 

//Prototypen

int pow10(int x);

uint32 get_ADC_Val(void);

void Print_Torque_ADC(uint8 ADC);

int length(int64 x);

 

 

//Globale Variablen

int64 Nullpunkt=0, Endwert=0;

 

float64 FE=0;

 

#if defined (__GNUC__)

    /* Add an explicit reference to the floating point printf library */

    /* to allow the usage of floating point conversion specifiers. */

    /* This is not linked in by default with the newlib-nano library. */

    asm (".global _printf_float");

#endif

 

//ISRs

CY_ISR(SW2_ISR)

{

    USBUART_1_PutString("Hallo ");

}

 

CY_ISR(SW3_ISR)

{

USBUART_1_PutCRLF();

}

 

CY_ISR(Counter_Comp_ISR)//timer gesteuerter interrupt zum ausgeben der messdaten

{

int clear=0; //nutzloser variablenwert

uint32 adcval=0;

char8 lineStr[20];

Counter_1_Stop();

Counter_1_WriteCounter(0);

clear=Counter_1_STATUS;//clear sticky Comp-Interrupt flag

    Print_Torque_ADC(PRINT_TORQUE);

Counter_1_Start();

}

 

void main()

{

    uint16 count, i, j, wert, get_stx, get_etx ,count_buffer, Index;

uint32 temp_ADC_Val=0,compare=0;

    uint8 buffer[BUFFER_LEN],buffer_temp[BUFFER_LEN], Nullpunkt_EE[CYDEV_EEPROM_ROW_SIZE], Endwert_EE[CYDEV_EEPROM_ROW_SIZE];

    char8 outStr[20];

    reg8 * RegPointer;

    

    /* Enable Global Interrupts */

    CyGlobalIntEnable;            

CounterISR_StartEx(Counter_Comp_ISR);

 

    /* Start USBFS Operation with 3V operation */

    USBUART_1_Start(0u, USBUART_1_3V_OPERATION);

 

    EEPROM_1_Start();

 

    

    /* Wait for Device to enumerate */

    while(!USBUART_1_GetConfiguration());

 

    /* Enumeration is done, enable OUT endpoint for receive data from Host */

    USBUART_1_CDC_Init();

 

this is the beginning of my main. can you tell me if there is something wrong with the place?

hli
user_78878863's picture
User
2051 posts

No, this place is quite OK. But I don't see in your code the place where you start the actual ISR components (SW2 / SW3). And when they are not started, they won't get triggered...

user_1377889's picture
User
5982 posts

Seems to be a complete german help...

Look at the warnings you've got: you do not call the function Counter_1_STATUS, you just save its addreess in the variable clear thus not clearing the sticky interrupt-bit. just forgot to write Counter_1_STATUS().

 

Bob

hli
user_78878863's picture
User
2051 posts

@bob: mixed up threads? Looks like the answer belongs to here: http://www.cypress.com/?app=forum&id=2233&rID=89319

Bastianpoto's picture
User
6 posts

 hi together and thanks for your replies,

 

you are right the SW2 and SW3 ISRs were used for debugging purpose. I deleted them, my problem is this:

im supposed to write a code that gets Data via UART for instance if i receive a 02P03 the box is supposed to transfer the ADC Value to the Software.

The Software works without problems in WIndows XP but as soon as the Software runs on Win7 it doesnt even receive the Data from the Software. For Debugging I used your example for USBUART:

   sprintf(lineStr,"BR:%4ld,DB:%d",USBUART_1_GetDTERate(),(uint16)USBUART_1_GetDataBits());

                LCD_Position(0u, 0u);

                LCD_PrintString("                    ");

                LCD_Position(0u, 0u);

                LCD_PrintString(lineStr);

                sprintf(lineStr,"SB:%s,Parity:%s", stop[(uint16)USBUART_1_GetCharFormat()], \

                                                     parity[(uint16)USBUART_1_GetParityType()]);

                LCD_Position(1u, 0u);

                LCD_PrintString("                    ");

                LCD_Position(1u, 0u);

                LCD_PrintString(lineStr);

with this active I can see that the PSoC changes from parity none to odd(Software requirements) but still doesnt receive anything in the buffer.

Is it the Driver the problem? The Driver installation on Win7 was very slow compared to XP as well. 

user_1377889's picture
User
5982 posts

@hli,

no, my answer is right for this question and if you have a look into the isr for the timer at variable "clear" you'll see that the interrupt bit is NOT resetted.

 

Bob

Bastianpoto's picture
User
6 posts

I have modified my code according to your tip, 

now i use Counter_1_ReadStatusRegister(); instead of int clear=0; clear=Counter_1_STATUS; it works fine this way :)

user_1377889's picture
User
5982 posts

Glad to here that!

BTW: which part of Germany you are from?

 

Bob

Bastianpoto's picture
User
6 posts

 was my source code german/english annotation so obvious? :D 

im from Essen :)

Bastianpoto's picture
User
6 posts

 is it possible to set the default parity for the usbuart module to odd?

and where and how can I do this?

hli
user_78878863's picture
User
2051 posts

Such a setting is not available. It also makes no sense, since USBUART doesn't involve a physical UART where such a setting could be applied.

user_1377889's picture
User
5982 posts

The USBUART usermodule is an USB-connection from your PSoC to your PC. On the PC-side a windows driver emulates a COM:-port so that a terminal-software can take over. As you see, the PSoC does not "see" something like an RS232 interface where parity, start and stopbits may be defined. With the appropiate software it could be possible to define a parity within the PC-emulation, but that would not make sense since parity is used to detect errors in a transmission which at this stage already has happened.

 

Bob

PS: Located near Bremen

Bastianpoto's picture
User
6 posts

 Thanks for the clearification :) 

this is good to know. My problem still occurs, is it possible that the Drivers have any known problems? that would be my only guess right now. 

And greetings to Bremen ;)

user_14586677's picture
User
7284 posts

This may help -

 

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}

http://video.cypress.com/video-library/video/PSoC-Software/PSoC-35-USB-Features-and-Basics/1740013095001

 

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}

http://www.youtube.com/watch?v=HdK1wHRucH8

 

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}

http://www.cypress.com/?rID=39404     AN57473

 

AN58726 - PSoC® 3 / PSoC 5LP USB HID Intermediate (with Keyboard and Composite Device)
06/27/2013

AN49943 - PSoC® 1 USB-to-UART Bridge
09/30/2013

AN56377 - PSoC® 3 and PSoC 5LP USB Transfer Types
05/28/2013

AN52970 - Windows Hardware Quality Labs (WHQL) Signing Procedure for Customer Modified Cypress USB Driver Files
07/10/2012

AN57294 - USB 101: An Introduction to Universal Serial Bus 2.0
04/18/2012

 

Regards, Dana

Log in to post new comments.