<?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/3254" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-09-13T20:21:03+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2009-09-13T20:21:03+02:00</updated>

		<published>2009-09-13T20:21:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3254&amp;p=10932#p10932</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3254&amp;p=10932#p10932"/>
		<title type="html"><![CDATA[AtTiny45 port PB1]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3254&amp;p=10932#p10932"><![CDATA[
Hi,<br /><br />I have a strage problem. I am working on a board similar to data logger but not using the HID mode. I am using open source win usb lib. Project web site is this . <br /><!-- m --><a class="postlink" href="http://www.harbaum.org/till/i2c_tiny_usb/index.shtml">http://www.harbaum.org/till/i2c_tiny_usb/index.shtml</a><!-- m --><br /><br />When I connect the board to PC usb input , usb detection is OK. Device is working. When I pull down PB1 (port 6) of the Tiny45. USB comminication is broken. <br /><br />PB1 port is just reading in main loop. It does not do anything else.When I make the same test with PB5 (pin1) it is OK. However I need that port as ADC so I have to use PB1 as input pin. I also use external crystal so only solution is to solve this isue.<br /><br />Any idea is very appricated.<br /><br />I am programming Tiny45 in High voltage programming mode  fuse bits are as below.<br />high fuse: 01111111<br />low fuse: 11101000<br /><br />  <br />   //POWER STATE DEFINE<br />   #define UPS_PORT   PORTB<br />   #define UPS_PIN    PINB<br />   #define UPS_DDR    DDRB<br />   #define UPS_POWER_LEVEL    _BV(5)<br />   #define UPS_POWER_STATE    _BV(1)<br /><br />   static void keyPoll(void)<br />   {<br />      if (UPS_PIN &amp; UPS_POWER_STATE)<br />      {<br />          //todo<br />      }<br />     else<br />     {<br />          //todo<br />     }<br />}<br /><br />static void timerInit(void)<br />{<br />  /* select clock: 16.5M/1k -&gt; overflow rate = 16.5M/256k = 62.94 Hz */<br />  TCCR1 = 0x0b;           <br /><br />  TCCR0A &amp;= ~(0xC0);//PWM COMPARATOR OUTPUT DISABLE FOR PIN 6 (PB1)<br />}<br /><br /><br />intmain(void) {<br />  wdt_enable(WDTO_1S);<br /><br />  /* clear usb ports */<br />  USB_CFG_IOPORT   &amp;= (uchar)~((1&lt;&lt;USB_CFG_DMINUS_BIT)|(1&lt;&lt;USB_CFG_DPLUS_BIT));<br /><br />  /* make usb data lines outputs */<br />  USBDDR    |= ((1&lt;&lt;USB_CFG_DMINUS_BIT)|(1&lt;&lt;USB_CFG_DPLUS_BIT));<br /><br />  /* USB Reset by device only required on Watchdog Reset */<br />  _delay_loop_2(40000);   // 10ms<br /><br />  /* make usb data lines inputs */<br />  USBDDR &amp;= ~((1&lt;&lt;USB_CFG_DMINUS_BIT)|(1&lt;&lt;USB_CFG_DPLUS_BIT));<br />  <br />  timerInit();<br />  usbInit();<br /><br />  //PCMSK &amp;=~(UPS_POWER_STATE); <br />  PCMSK =0x00;   <br /><br />  ACSR &amp;= ~(0x08); //disable analog interrupt<br />  ACSR |= 0x80; //analog comparator disable<br />  UPS_DDR &amp;= ~(UPS_POWER_STATE);            // port is input<br />    /* make UPS_POWER_LEVEL outputs */<br />  UPS_PORT &amp;= ~(UPS_POWER_STATE);            // disable pullup<br />  GIMSK &amp;= ~0x20; //disable pin interrupt<br />  <br />  sei();<br />  <br />  for(;;) {/* main event loop */<br />    wdt_reset();<br />    usbPoll();<br />     keyPoll();<br />  }<br /><br />  return 0;<p>Statistics: Posted by Guest — Sun Sep 13, 2009 8:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
