Tv.out pinout change possible?

TL;DR how to change sync pin on UNO

I am trying to use the TV.out library to display info to my cars head unit and it works well on its own but once I add the can bus shield there are overlapping pins and I can only have one or the other.

I was able to swap the video pin to a few places, now on pin 4 (instead of 7) but the sync pin will not move. Here is the exert of the setup that apples to my UNO:

#elif defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
//video
#if defined(ENABLE_FAST_OUTPUT)
#define PORT_VID	PORTD
#define	DDR_VID		DDRD
#define	VID_PIN		7
#else
#define PORT_VID	PORTB
#define	DDR_VID		DDRB
#define	VID_PIN		0
#endif
//sync
#define PORT_SYNC	PORTB
#define DDR_SYNC	DDRB
#define SYNC_PIN	1
//sound
#define PORT_SND	PORTB
#define DDR_SND		DDRB
#define	SND_PIN		3

In theory I should be able to swap the sound and sync as I dont need sound right?
Why does the sync pin define as 1 if its pin nine?
Has anyone swapped the sync pin?

Please help

On the ATmega328p (UNO, Nano, Mini)
PORTD bits 0 through 7 are Arduino Pins 0 through 7
PORTB bits 0 through 5 are Arduino Pins 8 through 13

So PORTB bit 1 is Pin 9.

Thank you for your responce

So for pin 11 Id set to 3, is there any other reason this would not work? I still dont get an output when i do this.

It is possible that the output is produced by a hardware timer. On an ATmega328p processor, each timer can only control two specific output pins. Depending on details it may or may not be possible to switch between the two by changing the programming.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.