<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/5751" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-06-19T16:10:38+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/5751</id>

		<entry>
		<author><name><![CDATA[hendrix13]]></name></author>
		<updated>2011-06-19T16:10:38+02:00</updated>

		<published>2011-06-19T16:10:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5751&amp;p=18743#p18743</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5751&amp;p=18743#p18743"/>
		<title type="html"><![CDATA[Porting V-USB to Atmega48 / 88 / 168 - important hint]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5751&amp;p=18743#p18743"><![CDATA[
I run into problems with porting HIDKeys and some other projects from ATmega8 to ATmega48 and could not succeed with hints from other posters. I finaly solved the problem with some important changes at the end of usbconfig.h. The trick was:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#define USB_INTR_CFG           EICRA /*  not   MCUCR */<br />/* #define USB_INTR_CFG_SET        ((1 &lt;&lt; ISC00) | (1 &lt;&lt; ISC01)) */<br />/* #define USB_INTR_CFG_CLR           0 */<br /> #define USB_INTR_ENABLE        EIMSK   /* not    GIMSK */<br />/* #define USB_INTR_ENABLE_BIT        INT0 */<br /> #define USB_INTR_PENDING        EIFR    /* not     GIFR */<br />/* #define USB_INTR_PENDING_BIT       INTF0 */<br /></code></pre></div><br /><br />ATMEL changed some register names with Atmega48/88/168, so V-USB needs these changes to let the driver enable external interrupt INT0. Wondering why I got no error messages before changing this  like for TCCR0 and TIFR (has to be TCCR0B and TIFR0). My Atmega48 works fine with 12 MHz, 5 V from USB and 68 Ohm / 3,6V zener diodes at the data lines. <br /><br />Of course don´t forget to uncheck the CLKDIV8-fuse and it is a good idea to use the latest usbdrv from 11-2008 even with the older projects.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5351">hendrix13</a> — Sun Jun 19, 2011 4:10 pm</p><hr />
]]></content>
	</entry>
	</feed>
