Arduino pro mini outputting TVout

So i've been using the TVout library with an arduino uno to run a camcorder CRT. Now i'm trying to run the same program on a pro mini and i can't get any signal out of it. I had problems even uploading to the pro mini, but i've tested out some simple LED programs and they work just fine, so the arduino itself should be fine.

I've noticed that the video output pin for TVout is pin 7 (which i'm guessing needs to be a PWM pin because it's outputting an analog signal), but pin 7 is not a PWM pin on the pro mini.

Any way to change output pins? If not, is there any other arduino that would work? I just need it to be as small as possible.

Uploading the formatted pro mini code using code tags might help.
Else, editing the library changing the output pin might be possible. Which timer the library use is likely important.

Here's the entire code, not sure if it's what you were asking for. The output pins defined in TVout seem to be in hardware_setup.h, so i'm posting it as well.

#include <TVout.h>
#include <video_gen.h> //runs fine without this, but i'm including it anyway
#include "zero.h"
#include "one.h"
#include "two.h"
#include "three.h"
#include "four.h"
#include "five.h"
#include "six.h"
#include "seven.h"
#include "eight.h"
#include "nine.h"
#include "dot.h"
#include "blank.h"
  //the images used are 40x64, except dot.h which is 12x49

TVout TV;

const int Time = 2; //pin 2 is used to set time

int TimeState = 0;

int minutes[10] = {zero, one, two, three, four , five, six, seven, eight, nine};
int tensminutes[6] = {zero, one, two, three, four, five};
int hours[10] = {zero, one, two, three, four , five, six, seven, eight, nine};
int tenshours[3] = {zero, one, two};
int m = 0; //minutes
int tm = 0; //tens of minutes
int h = 0; //hours
int th = 0; //tens of hours
int s = 4; // selector
int i = 0; //timer

void setup() {

  TV.begin(PAL, 189, 78); //resolution and initial images
  TV.bitmap(86, 20, dot);
  TV.bitmap(0, 10, zero);
  TV.bitmap(43, 10, zero);
  TV.bitmap(101, 10, zero);
  TV.bitmap(144, 10, zero);

  pinMode(Time, INPUT);

}

void loop() {
  unsigned char w;

  TimeState = digitalRead(Time);

  //selector cycle. if s=1 -> increment minutes, if s=2 -> increment tensminutes...
  if (TimeState != HIGH) {
    if ((s == 1) && (TimeState != HIGH)) {
      TV.bitmap(144, 10, two);
      TV.delay (1000);
    }

    if ((s == 2) && (TimeState != HIGH)) {
      TV.bitmap(144, 10, three);
      TV.delay (1000);
    }

    if ((s == 3) && (TimeState != HIGH)) {
      TV.bitmap(144, 10, four);
      TV.delay (1000);
    }

    if ((s == 4) && (TimeState != HIGH)) {
      TV.bitmap(144, 10, one);
      TV.delay (1000);
    }

    if (TimeState != HIGH) {
      s = s + 1;
    }

    if (s == 5) {
      s = 1;
    }

    TimeState = digitalRead(Time);

    if (TimeState != HIGH) {
      return;
    }


  //flashing current time
    if (TimeState != LOW) {
      TV.bitmap(0, 10, blank);
      TV.bitmap(43, 10, blank);
      TV.bitmap(101, 10, blank);
      TV.bitmap(144, 10, blank);
      TV.delay(500);
      TV.bitmap(0, 10, tenshours[th]);
      TV.bitmap(43, 10, hours[h]);
      TV.bitmap(101, 10, tensminutes[tm]);
      TV.bitmap(144, 10, minutes[m]);
      TV.delay(500);
      TV.bitmap(0, 10, blank);
      TV.bitmap(43, 10, blank);
      TV.bitmap(101, 10, blank);
      TV.bitmap(144, 10, blank);
      TV.delay(500);
      TV.bitmap(0, 10, tenshours[th]);
      TV.bitmap(43, 10, hours[h]);
      TV.bitmap(101, 10, tensminutes[tm]);
      TV.bitmap(144, 10, minutes[m]);
      TV.delay(1000);
    }

    TimeState = digitalRead(Time);

  //incrementor
point:

    if ((s == 1) && (TimeState != HIGH)) {
      m = m + 1;
      if (m == 10) {
        m = 0;
        TV.bitmap(144, 10, minutes[m]);
        TV.delay (1000);
      }
      else {
        TV.bitmap(144, 10, minutes[m]);
        TV.delay (1000);
      }
    }

    if ((s == 2) && (TimeState != HIGH)) {
      tm = tm + 1;
      if (tm == 6) {
        tm = 0;
        TV.bitmap(101, 10, tensminutes[tm]);
        TV.delay (1000);
      }
      else {
        TV.bitmap(101, 10, tensminutes[tm]);
        TV.delay (1000);
      }
    }

    if ((s == 3) && (TimeState != HIGH)) {
      h = h + 1;
      if (h == 10) {
        h = 0;
        TV.bitmap(43, 10, hours[h]);
        TV.delay (1000);
      }
      else {
        TV.bitmap(43, 10, hours[h]);
        TV.delay (1000);
      }
    }

    if ((s == 4) && (TimeState != HIGH)) {
      th = th + 1;
      if (th == 3) {
        th = 0;
        TV.bitmap(0, 10, tenshours[th]);
        TV.delay (1000);
      }
      else {
        TV.bitmap(0, 10, tenshours[th]);
        TV.delay (1000);
      }
    }

    TimeState = digitalRead(Time);

    if (TimeState != HIGH) {
      goto point; //i've heard some people don't like the "goto" function, this is good criticism that i won't be taking into account
    }
  }

  //clock
  while (i <= 59) {
    i = i + 1;
    TV.delay(1000);
    TimeState = digitalRead(Time);
    if (TimeState == LOW) {
      i = 0;
      return;
    }
  }

  i = 0;
  m = m + 1;

  if (m == 10) {
    m = 0;
    tm = tm + 1;
  }

  if (tm == 6) {
    tm = 0;
    h = h + 1;
  }

  if (h == 10) {
    h = 0;
    th = th + 1;
  }

  if (th == 3) {
    th = 0;
  }

  if ((h == 4) && (th == 2)) {
    h = 0;
    th = 0;
  }

  //display current time
  TV.bitmap(0, 10, tenshours[th]);
  TV.bitmap(43, 10, hours[h]);
  TV.bitmap(101, 10, tensminutes[tm]);
  TV.bitmap(144, 10, minutes[m]);

}

hardware_setup.h

/*
 Copyright (c) 2010 Myles Metzer

 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
 files (the "Software"), to deal in the Software without
 restriction, including without limitation the rights to use,
 copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the
 Software is furnished to do so, subject to the following
 conditions:

 The above copyright notice and this permission notice shall be
 included in all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
*/

// sound is output on OC2A
// sync output is on OC1A

//ENABLE_FAST_OUTPUT chooses the highest bit of a port over the original output method
//comment out this line to switch back to the original output pins.
#define ENABLE_FAST_OUTPUT

#ifndef HARDWARE_SETUP_H
#define HARDWARE_SETUP_H

// device specific settings.
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#if defined(ENABLE_FAST_OUTPUT)
#define PORT_VID	PORTA
#define	DDR_VID		DDRA
#define VID_PIN		7
#else
//video
#define PORT_VID	PORTB
#define	DDR_VID		DDRB
#define VID_PIN		6
#endif
//sync
#define PORT_SYNC	PORTB
#define DDR_SYNC	DDRB
#define	SYNC_PIN	5
//sound
#define PORT_SND	PORTB
#define DDR_SND		DDRB
#define	SND_PIN		4

#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
//video
#if defined(ENABLE_FAST_OUTPUT)
#define PORT_VID	PORTA
#define	DDR_VID		DDRA
#define VID_PIN		7
#else
#define PORT_VID	PORTD
#define	DDR_VID		DDRD
#define VID_PIN		4
#endif
//sync
#define PORT_SYNC	PORTD
#define DDR_SYNC	DDRD
#define SYNC_PIN	5
//sound
#define PORT_SND	PORTD
#define DDR_SND		DDRD
#define	SND_PIN		7

#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

#elif defined (__AVR_AT90USB1286__)
//video
#define PORT_VID	PORTF
#define	DDR_VID		DDRF
#define	VID_PIN		7
//sync
#define PORT_SYNC	PORTB
#define DDR_SYNC	DDRB
#define SYNC_PIN	5
//sound
#define PORT_SND	PORTB
#define DDR_SND		DDRB
#define	SND_PIN		4
#elif defined(__AVR_ATmega32U4__) // Modified for Arduino Leonardo
//video
#define PORT_VID	PORTB
#define	DDR_VID		DDRB
#define	VID_PIN		4 // 8
//sync
#define PORT_SYNC	PORTB
#define DDR_SYNC	DDRB
#define SYNC_PIN	5 // 9
//sound
#define PORT_SND	PORTB
#define DDR_SND		DDRB
#define	SND_PIN		7 // 11
#define TCCR2A		TCCR0A
#define TCCR2B		TCCR0B
#define OCR2A		OCR0A
#define OCR2B		OCR0B
#define COM2A0		COM0A0
#define COM2A1		COM0A1
#define CS20		CS00
#define WGM21		WGM01
#endif

//automatic BST/BLD/ANDI macro definition
#if VID_PIN == 0
#define BLD_HWS		"bld	r16,0\n\t"
#define BST_HWS		"bst	r16,0\n\t"
#define ANDI_HWS	"andi	r16,0xFE\n"
#elif VID_PIN == 1
#define BLD_HWS		"bld	r16,1\n\t"
#define BST_HWS		"bst	r16,1\n\t"
#define ANDI_HWS	"andi	r16,0xFD\n"
#elif VID_PIN == 2
#define BLD_HWS		"bld	r16,2\n\t"
#define BST_HWS		"bst	r16,2\n\t"
#define ANDI_HWS	"andi	r16,0xFB\n"
#elif VID_PIN == 3
#define BLD_HWS		"bld	r16,3\n\t"
#define BST_HWS		"bst	r16,3\n\t"
#define ANDI_HWS	"andi	r16,0xF7\n"
#elif VID_PIN == 4
#define BLD_HWS		"bld	r16,4\n\t"
#define BST_HWS		"bst	r16,4\n\t"
#define ANDI_HWS	"andi	r16,0xEF\n"
#elif VID_PIN == 5
#define BLD_HWS		"bld	r16,5\n\t"
#define BST_HWS		"bst	r16,5\n\t"
#define ANDI_HWS	"andi	r16,0xDF\n"
#elif VID_PIN == 6
#define BLD_HWS		"bld	r16,6\n\t"
#define BST_HWS		"bst	r16,6\n\t"
#define ANDI_HWS	"andi	r16,0xBF\n"
#elif VID_PIN == 7
#define BLD_HWS		"bld	r16,7\n\t"
#define BST_HWS		"bst	r16,7\n\t"
#define ANDI_HWS	"andi	r16,0x7F\n"
#endif
#endif

For the record, the pro mini and arduino uno i have use ATmega 328P

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