QG8 PTA4 does not work as Output pin

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

QG8 PTA4 does not work as Output pin

1,524 次查看
abicash
Contributor III

Hello

 

I have initialised as thus

SOPT1        = 0x00;   // RESET and BKGD disabled

 

The idea is to use the RESET/PTA5 pin as input pulled up to Vdd and connected to ground through a push button switch.

 

Once the switch is pressed , i poll it and turn on a LED for 10 seconds (currently PTA4 is not connected to any LED or transistor)

Now this scheme works with LED connected to PTB5, but with PTA4 ,it never goes high.

 

It does not change state with or without pull up.

 

Am i doing something fundamentally wrong?

 

The entire design is complete and only this small issue might make me change the MCU..

 

Any help appreciated

标签 (1)
0 项奖励
回复
9 回复数

1,241 次查看
pauloprecursor
Contributor I

I´m facing the same problem with ...QD2.

I need to use all device pins, and PTA4 is the "chip enable" of a Serial Flash Memory.

In spite of having one 3.3kohm pull-up, and the SOPT1 is initialized with $00,

its output is always 1.

0 项奖励
回复

1,241 次查看
abicash
Contributor III

Can someone throw some light here?

0 项奖励
回复

1,241 次查看
Cram
Contributor III

Hi,

Since your SOPT1 sesms to be right, did you check your PTADD init proces? Set PTA4=1? DO you PTA4 shgare any function that may force your pin to be set to 0?

0 项奖励
回复

1,241 次查看
tonyp
Senior Contributor II

SOPT1 is write-once, so maybe something (e.g., startup code) writes it before you do.  Have you checked that it is indeed written with zero?

0 项奖励
回复

1,241 次查看
abicash
Contributor III

Hi and thanks for replying

There is no startup code present.

If you noticed my original post, i am using RESET as PTA5 to get a push button status and drive an LED connected to PTB5, so SOPT1 is getting written to 0.

I checked on other QG8 chips but same thing repeated.

I browsed through many threads here explaining this phenomena but each and every explanation is void in my case.

Any help appreciated

0 项奖励
回复

1,241 次查看
bigmac
Specialist III

Hello,

According to the datasheet for the 'QG8 (refer to Fig. 1.1), PTA4 is an input-only pin, whereas PTA5 is an output only pin (when BKGD/MS is disabled).  All other GPIO pins are bi-directional, as controlled by the data direction registers.  Also see paragraph 6.4.1.2, where it is confirmed that the DDR bit settings have no effect.

Regards,

Mac

0 项奖励
回复

1,241 次查看
abicash
Contributor III

Hello bigmac

Is there a mistake in your reply?

PTA4 is an output-only pin and PTA5 is an input-only pin as i understand

I can test this by getting PTA5 as i/p pin to control LED connected at PTB5.

Thanks

0 项奖励
回复

1,241 次查看
bigmac
Specialist III

Hello,

Yes, I confused the two pins.

I also assume that you disconnect the Multilink programmer/debugger when you test this arrangement.  Otherwise there is likely to be a conflict at PTA4 output.

Regards,

Mac


0 项奖励
回复

1,241 次查看
abicash
Contributor III

Hello mac

I do disconnect the Multilink after programming.

I have now added a 5k6 pullup on the RESET and BKGD pin.

As soon as POR occurs, The BKGD pin goes to 0v and never pulls up to 3.3v, whereas RESET/PTA5 functions as an i/p pin .Here i connect a Push-button switch ,other end of which is connected to ground.Once i press the button, i light an LED at PTB5 and turn  PTA4 (BKGD) high (here no other part, other than the pullup resistor is present).

i find that LED lights but the PTA4 doesn't change state.

Tried this on few other QG8's from the tube , but to no avail.

Is there something fundamentally wrong which i am doing?

0 项奖励
回复