I need to change P0[6] from an INPUT with PULL-UP (DRIVE) to an OUTPUT with STRONG (DRIVE) is assembler. What is the code to accomplish this?

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

cross mob
rgpace
Level 1
Level 1
5 replies posted First reply posted First question asked

I am using a CY8C29466-24PXI want to change P0[6] from an INPUT with PULL-UP (DRIVE) to an OUTPUT with STRONG (DRIVE) is assembler.  What is the code to accomplish this?

0 Likes
1 Solution
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

The code in "C" would be

DM0 =1, DM1 = 0, DM2 = 0 for strong drive.

PRT0DM0 != 0x40;

PRT0DM1 &= ~0x40;

PRT0DM2 &= ~0x40;

This would translate in assembler to be:

OR F, 0x10  ; Set register bank 1

OR REG[0x00], 0x40 ; PRT0DM0

AND REG[0x01], 0xBF; PRT0DM1

AND F, 0xCF ; Set register bank 0

AND REG[0x03], 0xBF; PRT0DM2

Best regards,

Sampath Selvaraj

View solution in original post

0 Likes
2 Replies
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

The code in "C" would be

DM0 =1, DM1 = 0, DM2 = 0 for strong drive.

PRT0DM0 != 0x40;

PRT0DM1 &= ~0x40;

PRT0DM2 &= ~0x40;

This would translate in assembler to be:

OR F, 0x10  ; Set register bank 1

OR REG[0x00], 0x40 ; PRT0DM0

AND REG[0x01], 0xBF; PRT0DM1

AND F, 0xCF ; Set register bank 0

AND REG[0x03], 0xBF; PRT0DM2

Best regards,

Sampath Selvaraj

0 Likes

Thank youSent via the Samsung Galaxy S8+, an AT&T 5G Evolution smartphone

0 Likes