what happens if PVR is read in peripheral mode?

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,

just saw this from the GPIO section of datasheet:

Quote:

Note that due to power saving measures, PVR register can only be read when GPER is set for the corresponding pin or if interrupt is enabled for the pin.

But what will happen if I set the pin to peripheral mode and read PVR register?

Cheng

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think the GPIO will stop sampling the pins when the pin GPER is not set and interrupt is disabled on the pin. So you will read old values in the PVR register.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

then is there a general way to read pin value used as an input by peripheral and still not disturb the peripheral function?

for example:
enable the GPIO of this pin and set it as input,
then read PVR
then set it back to peripheral mode

Will this cause the peripheral any problem?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

anyone knows?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It might help if we have more of your application. It will cause a problem if an event which the peripheral is looking for occurs while you hold the pin.

I can't immediately think of a use-case where you'd want the same pin to be controlled by 2 processes (periph and gpio), as I say, more info would be nice :)

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a pin (SFD) from CC2420 connected to PB02 of UC3B0256. It should use TC_A1 as the periph function, but i also needs to know the pin value sometime in the program and i can't find any way to read this pin value in TC module, so...