Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leonardo/Micro/Esplora <32u4 Does Not Work> #76

Open
GoogleCodeExporter opened this issue Mar 26, 2015 · 2 comments
Open

Leonardo/Micro/Esplora <32u4 Does Not Work> #76

GoogleCodeExporter opened this issue Mar 26, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Arduino Leonardo has no support <Important>
2. Arduino Micro has no support
3. Arduino Esplora has no support
4. All 3 use the same chip

What is the expected output? What do you see instead?
The code compiles per issue 52, but it won't show anything on the display.

Hardware.h was modified according to 
http://code.google.com/p/arduino-tvout/issues/detail?id=52

And all other links on that page. 

The RX Led lights up and remains on. Reading with a voltimeter shows that 
Digital Pin 9 and Ground have movement, but no other pins.

What version of the product are you using? On what operating system?
Newest Beta, on Windows 8

Please provide any additional information below.

#elif defined(__AVR_ATmega32U4__)
//video
 #define _VID_PORT PORTE
 #define _VID_DDR DDRE
 #define _VID_PIN 6
 //sync
 #define _SYNC_PORT PORTB
 #define _SYNC_DDR DDRB
 #define _SYNC_PIN 5
 //sound
 #define _SND_PORT PORTB
 #define _SND_DDR DDRB
 #define _PIN_SND 7
#define _ANDI_HWS "andi r16, 0xBF \n"
#define _BLD_HWS "bld r16, 6\n\t"

That is the code that compiles.

Original issue reported on code.google.com by [email protected] on 16 Nov 2013 at 8:52

@abcbarryn
Copy link

I have found that the following patches allow the Arduino Leonardo to work with TVout with sound. Since the Leonardo does not have timer 2, this code replaces timer 2 with timer 0 and also adds pin definitions for the Leonardo. The + signs below indicate lines that were added.

--- TVout.cpp   2015-10-11 17:56:56.000000000 -0400
+++ TVout.cpp   2015-10-11 16:47:11.000000000 -0400
@@ -809,7 +809,11 @@
    if (frequency == 0)
        return;

+#if defined(__AVR_ATmega32U4__)
+#define TIMER 0
+#else
 #define TIMER 2
+#endif
    //this is init code
    TCCR2A = 0;
    TCCR2B = 0;
--- spec/hardware_setup.h.orig  2015-10-11 17:55:17.000000000 -0400
+++ spec/hardware_setup.h   2015-10-11 16:47:45.000000000 -0400
@@ -107,6 +107,27 @@
 #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

@abcbarryn
Copy link

I submitted a patch to fix this, but I do not see it applied here yet. You can download a new copy of TVout with these fixes applied from http://playground.arduino.cc/Main/TVout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants