GPIO0_0 (PWM)

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
Arek
Senior User
Posts: 53
Joined: Thu 2016-09-01 10:58

GPIO0_0 (PWM)

Post by Arek » Thu 2018-09-13 14:15

Hi,

Do I need to anything more as writing to DDR and set/clear GPIO0 bit make this pin output low/high?

Code: Select all

#define LED_RD_OFF 	PERIP(GPIO2_CLEAR_MASK) = (1<<6);
#define LED_RD_ON 	PERIP(GPIO2_SET_MASK) = (1<<6); 

#define AC_ON 		PERIP(GPIO0_SET_MASK)  = (1<<0);    	
#define AC_OFF	 	PERIP(GPIO0_CLEAR_MASK)= (1<<0);    	

and in main:

	PERIP(GPIO2_DDR) |= (1<<6);        // Data Direction 1: Output Led RT
	PERIP(GPIO0_DDR) |= (1<<0);        // Data Direction 1: Output AC ON/OFF


switching with LED_RD works, switching with AC_ON, OFF not -> have high level only.

Checked with two different modules.

Hannu
Senior User
Posts: 43
Joined: Mon 2016-05-30 11:54

Re: GPIO0_0 (PWM)

Post by Hannu » Thu 2018-09-13 14:28

Hello!

If you want to work with registers:

Code: Select all

PERIP(GPIO0_MODE) &= ~(1 <<0);
might be the solution
Or you could include vo_gpio.h and call

Code: Select all

GpioSetPin(0x00, 1); //Pin, state
GpioSetPin(0x00, 0);
GPIO0 pin 0: 0x00
GPIO0 pin 15: 0x0f
GPIO1 pin 3: 0x13

and so on...

Arek
Senior User
Posts: 53
Joined: Thu 2016-09-01 10:58

Re: GPIO0_0 (PWM)

Post by Arek » Thu 2018-09-13 14:41

Thank you Hannu,

The question is if GPIO0_0 (second function: PWM) need something more.
I don't have any problems to set or clear
GPIO2_6, GPIO2_7, GPIO0_7
Only GPIO0_0 (which has a secondary function) make trouble.

User avatar
Panu
VLSI Staff
Posts: 2585
Joined: Tue 2010-06-22 13:43

Re: GPIO0_0 (PWM)

Post by Panu » Thu 2018-09-13 15:30

Hmm, VS1005 PWM pin was switched to pull-down relaxation oscillator mode when PWRBTN is pressed, but in VS1005 the PWM/GPIO0_0 pin works normally when configured. ROM sets GPIO0_0 to high when music playback is started for the first time. So in VS1010, the GPIO0_0 pin can be used to drive XSHUTDOWN pin of an attached audio amplifier, to avoid any power-on clicks with the external amplifier.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Arek
Senior User
Posts: 53
Joined: Thu 2016-09-01 10:58

Re: GPIO0_0 (PWM)

Post by Arek » Thu 2018-09-13 16:04

Hi, many thanks.

I have to redesign my PCB (a few other changes) so I can switch to GPIO2_5 (works!) and... this case is closed.

Post Reply