cancel
Showing results for 
Search instead for 
Did you mean: 

MPWME and PDDR

daveevans9
Associate II
Posted on February 01, 2005 at 03:51

MPWME and PDDR

4 REPLIES 4
daveevans9
Associate II
Posted on May 17, 2011 at 10:18

Hi all,

device: 2FMC2S5T6

when I attempt to change MPWME I get PDDR change as well!

I go to page 1

; set up MCONF

LD A,#0x02

LD 0x53,A

;set MPWE = PWMV - debug off - 2.5uS

LD A,#0x20

LD 0x52,A

in registers

0x52 I see the 0x20 I write

and in register 0x09 [PDDR] which was 0xFF then becomes 0xFD!

I use port D for other things so it gets upset :o

Any suggestions?

Regards

DaveE

[ This message was edited by: DaveE on 21-01-2005 18:06 ]

[ This message was edited by: DaveE on 21-01-2005 22:05 ]

gaetano
Associate II
Posted on May 17, 2011 at 10:18

Hi,

please refer to the note #1 on page 19 of ST7MC datasheet to be sure that the I/O pins configured as input (if exist) don't overwrite what you wrote on the DR data register.

Please, let me know.

Tanio

daveevans9
Associate II
Posted on May 17, 2011 at 10:18

Tanio,

here's my code, this I'm sure this sets port D as floating input.

; make port all floating input

LD A,#0xff

LD 0x09,A ; set output latches high

CLR 0x0a ; set as all inputs DDDR

CLR 0x0b ; clear DDOR

after this point I set up the mtc.

Thanks

DaveE

gaetano
Associate II
Posted on May 17, 2011 at 10:18

Hello,

since the PD1 and MCPWMV are shared pins, this implies you cannot use the PD1 as pin of D port when you configure the PWM V to be output from the MTC peripheral.

The code you wrote try to perform these operation and that's the reason why you get that behaviour.

Best regards,

Tanio