SetDriveMode() forbidden in conjunction with UDB UART?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

 Hi All,

   

 

   

PSoC5LP CY8C5868AXI-LP035 - PSoC Creator 3.0

   

I'm using 3 UDB UARTs (1xRS232 & 2xRS485) for which the Tx lines should be shifted in HZ when needed in order not to parasitically feed their corresponding AD eCouplers when thoses are not used (Vccs cut thru the use of P channel Mosfets for energy saving purpose).

   

I wanted to use the SetDriveMode() possibility to shift the Tx lines either in (input) HZ or in (output) buffered mode when requested, but the compiler refuses this IO instruction for the 3 UARTs (error : implicit declaration of function 'SetDriveMode' is invalid).

   

I'm also using a CAN component the same way without this problem.

   

An alternative would be thru the use of the port-register manipulations, but I'd like to know if there is a reason not to be able to go with the current context.

   

 

   

Michel  

0 Likes
14 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The error message you are getting just means that the compiler doesn't know about the function you are calling.

   

According to the data sheet for thr pins component, use PINNAME_SetDriveMode() instead. (Or CyPins_SetPinDriveMode(pin,mode), see page 19 of the DS)

0 Likes
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

HLI,

   

 

   

Thx for your reply.

   

I know this but I hadn't developped the whole tag, omitting the prefix pin name for clarity in the post.

   

Have a look at this screen snaps:

   

 

   

   

 

   

   

0 Likes
lock attach
Attachments are accessible only for community members.
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Oh oh, no way to get the snaps in the post once pasted & sent?

0 Likes
lock attach
Attachments are accessible only for community members.
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

to be continued...

0 Likes
lock attach
Attachments are accessible only for community members.
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

The last one!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Wouldn't it be easier for you (and us) just to post the complete project using
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file (do NOT use chrome, that still may not work).
So we could play around and see how to circumvent the issue.

   

 

   

Bob
 

0 Likes
lock attach
Attachments are accessible only for community members.
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Hello Bob

   

How dyd?

   

I have 'slightly' simplified the code (no need for the whole one); howerver I've kept the original drawings.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The system reference manual, in help, or the below ap note

   

discuss how to handle per component and per pin APIs.

   

 

   

    

   

          

   

http://www.cypress.com/?rID=57571    AN72382

   

 

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I'm without Creator right now (Linux machine), so maybe I'm looking wrong: in the generated code, there is no component called 'PL1_TX' or 'PL2_TX', only 'PL1_TXEN'.

   

I can see something called PL1_TX in some other header files (e.g. cyfitter.h), but there should be a source code file called PL1_TX.h

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Poster has pins named PL1_TX .......

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I do not know why, but for the pins under "Built-in" is "CY_Suppress_API_Gen" set to false. This will prevent that the .h and .c files for the component are generated.

   

 

   

Bob 

0 Likes
MiKO_283856
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Bob, HLI & Dana,

   

Don't know myself why (may be a mistake at the beginnig of this project, I started it with a copy of an old one ), but activating (setting CY_SUPPRESS_API_GEN to false) solved.

   

Thx a lot guys for your precious help, bug resolved.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Great! And as usual: You are always welocme!

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

You are always welcome.

   

 

   

Dana.

0 Likes