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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-10-02T21:13:24+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-10-02T21:13:24+02:00</updated>

		<published>2014-10-02T21:13:24+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28275#p28275</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28275#p28275"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28275#p28275"><![CDATA[
It has been a while, but I have finally found a few spare moments to take a look at my C64 keyboard circuit.  I decided to plug in the oscilloscope to see if there were signal problems on the D+ line.<br /><br /><img src="http://i.imgur.com/qH8M0qI.png" class="postimage" alt="Image" /><br /><br />The scope was told to read the first few hundred microseconds of data output.  It appears to be similar to the observations made by blargg in the thread about polling.  Other, not pictured, tests confirmed that the crystal was oscillating at 12MHz and that the filtered 5V input line was very stable.  <br /><br />Does anyone have any interpretations of this?  I assume that this suggests that there are no problems with the circuit being used.  Any problems are presumably in the coding.<br /><br />I have been unable to address a previous observation that the report was not matching up with the expected report length.  This was mentioned when running through USBlyzer, but my trial has since run out.  I can investigate that again when I resolve the trial expiration issue.<br /><br />Suggestions welcome.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Thu Oct 02, 2014 9:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-09-02T03:07:35+02:00</updated>

		<published>2014-09-02T03:07:35+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28086#p28086</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28086#p28086"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28086#p28086"><![CDATA[
Another interesting observation.  <br /><br />When the board is powered through the tinyusb programmer, the C64LED is always on.  When the board is powered through the USB connector, C64LED stays lit for 1.52 s (average of three tests with a stopwatch), then turns off until re-plugged.  The LED is powered by the UART TX in the PD1 pin.  Is this a useful symptom of my problem?  The main.c file checks the led state at the start, then ignores it.  Old versions of the code apparently used PD1 as a UART debugging pin.  Has there been some change in the VUSB code since ca. Jan-2008 that might cause some interference here?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Tue Sep 02, 2014 3:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-09-01T02:57:15+02:00</updated>

		<published>2014-09-01T02:57:15+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28083#p28083</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28083#p28083"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28083#p28083"><![CDATA[
My computers now acknowledge that the device exists, at least in part.  The keyboard is not usable though.<br /><br />Plugging into Windows results is two possible outcomes.  If the keyboard is attached to the circuit when plugged in, the device <em class="text-italics">sometimes</em> gives error 43.  If the keyboard is not attached to the surface, the device always is recognized as HID Keyboard.  The device name and vendor name are omitted.  I tried changing the VID/PID pair to force Windows to use new entries (rather than dealing with registry hacks), but this did not change anything.  I assume if the report descriptors are correct in the usbconfig, then I should see &quot;SpacemanSpiff&quot; instead of &quot;(standard keyboard)&quot;.  <br /><br />Plugging into the raspi, I can only get this.  I tried to sudo bash a forced rebind of the usb device, but I still have incomplete information on the report descriptor.  I would guess that this is the source of my problems with identification.  Anyone have any thoughts?<br /><br /><div class="codebox"><p>Code: </p><pre><code>lsusb -vd f055:000f<br /><br />Bus 001 Device 016: ID f055:000f<br />Couldn't open device, some information will be missing<br />Device Descriptor:<br />  bLength                18<br />  bDescriptorType         1<br />  bcdUSB               1.10<br />  bDeviceClass            0 (Defined at Interface level)<br />  bDeviceSubClass         0<br />  bDeviceProtocol         0<br />  bMaxPacketSize0         8<br />  idVendor           0xf055<br />  idProduct          0x000f<br />  bcdDevice            1.00<br />  iManufacturer           1<br />  iProduct                2<br />  iSerial                 0<br />  bNumConfigurations      1<br />  Configuration Descriptor:<br />    bLength                 9<br />    bDescriptorType         2<br />    wTotalLength           34<br />    bNumInterfaces          1<br />    bConfigurationValue     1<br />    iConfiguration          0<br />    bmAttributes         0x80<br />      (Bus Powered)<br />    MaxPower              100mA<br />    Interface Descriptor:<br />      bLength                 9<br />      bDescriptorType         4<br />      bInterfaceNumber        0<br />      bAlternateSetting       0<br />      bNumEndpoints           1<br />      bInterfaceClass         3 Human Interface Device<br />      bInterfaceSubClass      1 Boot Interface Subclass<br />      bInterfaceProtocol      1 Keyboard<br />      iInterface              0<br />        HID Device Descriptor:<br />          bLength                 9<br />          bDescriptorType        33<br />          bcdHID               1.01<br />          bCountryCode            0 Not supported<br />          bNumDescriptors         1<br />          bDescriptorType        34 Report<br />          wDescriptorLength      63<br />         Report Descriptors:<br />           ** UNAVAILABLE **<br />      Endpoint Descriptor:<br />        bLength                 7<br />        bDescriptorType         5<br />        bEndpointAddress     0x81  EP 1 IN<br />        bmAttributes            3<br />          Transfer Type            Interrupt<br />          Synch Type               None<br />          Usage Type               Data<br />        wMaxPacketSize     0x0008  1x 8 bytes<br />        bInterval              10</code></pre></div><br /><br />I think I should tackle this identification issue before I try to determine why the keyboard isn't sending keystrokes.  I have confirmed that the keyboard PCB is fine, and there is decent conductivity in the wires.<br /><br /><br />Also, since blargg asked for pictures, I took some of the two versions I have made of this circuit.<br /><br />Obverse<br /><img src="http://i.imgur.com/NdIKgE9.jpg" class="postimage" alt="Image" /><br /><br />Reverse<br /><img src="http://i.imgur.com/yGMZSsW.jpg" class="postimage" alt="Image" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Mon Sep 01, 2014 2:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-08-29T00:54:46+02:00</updated>

		<published>2014-08-29T00:54:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28065#p28065</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28065#p28065"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28065#p28065"><![CDATA[
Success.  The computer is now recognizing that it is, in fact, a device.  This occurred through a series of steps.<br /><br />1. Tried to blink.  Failed.  No response.<br /><br />2. PI suggested that the diodes were pretty much pointless for a device with such low power.  I should remove the diodes.<br /><br />3. Tried to blink.  Partial success.  The blinking had a total cycle time of exactly 12 seconds.<br /><br />4. Obvious solution -- Rewrite fuses.  (It is possible that the makefile was trying to give the proper fuses, but the device couldn't communicate due to the diode capacitance.  Manual was much more straightforward though.)<br /><br />5. Blink.  Success.<br /><br />6. Program, also apparent success.  I'm wondering if I need to change the #define USB_CFG_IS_SELF_POWERED line to 0, since I'm not working with an externally powered breadboard.<br /><br /><br />If I have total success, or more issues, I will report back.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Fri Aug 29, 2014 12:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-08-28T22:45:20+02:00</updated>

		<published>2014-08-28T22:45:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28064#p28064</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28064#p28064"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28064#p28064"><![CDATA[
<blockquote class="uncited"><div> Is your programmer going directly through the USB? I don't quite understand your setup if you changed those. </div></blockquote><br /><br />Here's the relevant portion of the schematic of a USBasp that I ran the code on. USB is on PB0 and PB1, with PB1 also tied to INT0.<br /><br /><img src="http://i.imgur.com/ykEnHOY.png" class="postimage" alt="Image" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Thu Aug 28, 2014 10:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-08-28T22:05:57+02:00</updated>

		<published>2014-08-28T22:05:57+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28063#p28063</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28063#p28063"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28063#p28063"><![CDATA[
So far today, I reverted the bits for the USB pins.  Is your programmer going directly through the USB?  I don't quite understand your setup if you changed those.  <br /><br />I also did some work with the diodes.  The voltage drop across D+ was 2.134V, across D- was 0V (resistor troubles).  I fixed the resistor and tried the series diodes you suggested in the other thread.  I've got 6 1n914 in total and in a similar arrangement.  The D+ to ground drop is now 3.567V and at D- to ground is 3.805V.  It seems like those should be closer to each other.  I may have to break out the osc. to look at the signal.  <br /><br />It seems R5 is reading 4k instead of 4k7, so I need to take a look at that too.<br />EDIT: Nevermind, the ground path just seems to be 4k.  The 4k7 wasn't a problem.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Thu Aug 28, 2014 10:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-08-28T07:16:51+02:00</updated>

		<published>2014-08-28T07:16:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28055#p28055</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28055#p28055"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28055#p28055"><![CDATA[
First thing I notice that's possibly a problem is the 1W zener diodes. I've read of <a href="http://forums.obdev.at/viewtopic.php?t=510" class="postlink">people having trouble with these</a> due to their capacitance, and recommendations to use 0.5W. If you don't have any handy, you could build a temporary alternate level converter with <a href="http://forums.obdev.at/viewtopic.php?f=8&amp;t=8751" class="postlink">6 generic signal diodes</a> just to see whether the rest of the circuit is OK.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Thu Aug 28, 2014 7:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-08-28T05:55:28+02:00</updated>

		<published>2014-08-28T05:55:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28054#p28054</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28054#p28054"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28054#p28054"><![CDATA[
Oh, you weren't unpleasant.  I'm only giving up for the evening.  I just had other projects that needed attention, and all of my stuff is in my lab on campus.  I am using this project as a learning experience for a set of chemical sensing devices I'm designing.  <br /><br />I can take pictures of the boards I made tomorrow.  Right now, I have this...<br /><br />The schematic: <img src="http://i.imgur.com/wp6OH6i.png" class="postimage" alt="Image" /><br /><br /><br />The board: <img src="http://i.imgur.com/vHF78Tk.png" class="postimage" alt="Image" /><br /><br /><br />Partslist<br /><div class="codebox"><p>Code: </p><pre><code>Part         Value              Package      Library  Position (inch)       Orientation<br /><br />ATMEGA8-PU16 ATMEGA8-PU         DIL28-3      atmega8  (1.15 1.5)            R180<br />C1           22pF               C025-024X044 resistor (0.9 1.9)             R0<br />C2           22pF               C025-024X044 resistor (1.8 1.9)             R0<br />C3           0.1uF              C025-024X044 resistor (1.45 1.05)           R270<br />C5           10uF               E2,5-5       resistor (1.15 0.15)           R270<br />C6           0.1uF              C025-024X044 resistor (1.75 1.05)           R270<br />C64KBD                          MA20-1       con-lstb (0.25 1)              R90<br />C64LED                          MA03-1       con-lstb (0.75 0.25)           R0<br />D1           1N4728             DO41Z10      diode    (1.65 0.4)            R0<br />D2           1N4728             DO41Z10      diode    (1.65 0.6)            R0<br />H1           MOUNT-PAD-ROUND2.8 2,8-PAD      holes    (1.1 0.65)            R0<br />ICSP                            MA03-2       con-lstb (1.05 1.05)           R0<br />Q1           12.000Mhz          QS           special  (1.35 1.85)           R0<br />R1           82R                0204V        resistor (1.8 0.8)             R180<br />R2           82R                0204V        resistor (1.3 0.4)             R0<br />R3           470R               0204V        resistor (1.5 1.2)             R0<br />R4           2k2R               0204V        resistor (1.5 0.8)             R180<br />R5           4k7R               0204V        resistor (0.6 1.9)             R180<br />USB                             PN61729      con-berg (1.6 0.05)            R0</code></pre></div><br /><br />Due to an error on my part, the USB pins are connected by patch wires rather than printed wires.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Thu Aug 28, 2014 5:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-08-28T04:21:22+02:00</updated>

		<published>2014-08-28T04:21:22+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28052#p28052</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28052#p28052"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28052#p28052"><![CDATA[
Sorry if I came across as unpleasant. I know you said you give up, but I think you probably did the changes right in your earlier message and showed pretty well that it's probably hardware. If you take some sharp photos of the front and back of the board, I'd be happy to look over them to see any problems. It sounds like you're close to having it work. Have you run a basic blink test to be sure you've got the crystal configured correctly? This should flash an LED on PD1 at one flash per second (on the schematic this connects to the C64's keyboard LED):<br /><br /><div class="codebox"><p>Code: </p><pre><code>#if 0<br />avr-gcc -mmcu=atmega8 -DF_CPU=12000000UL -Wall -Os -o blink.elf blink.c<br />avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex<br />avrdude -p atmega8 -P com1 -c usbtiny -U blink.hex<br />exit<br />#endif<br /><br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br /><br />int main( void )<br />{<br />   DDRD |= 1&lt;&lt;1; <br />   for ( ;; )<br />   {<br />      PORTD ^= 1&lt;&lt;1;<br />      _delay_ms(500);<br />   }<br />}<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Thu Aug 28, 2014 4:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lostchemist]]></name></author>
		<updated>2014-08-28T03:27:08+02:00</updated>

		<published>2014-08-28T03:27:08+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28051#p28051</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28051#p28051"/>
		<title type="html"><![CDATA[Re: Difficulties Replicating C64 USB]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9277&amp;p=28051#p28051"><![CDATA[
Alright.  I gave up for the day, moved on to different projects.  Clearly I'm new at this, I apologize if I keep missing the obvious.<br /><br />I find it odd though that if I changed the usb pins, the usbtiny still reported that the upload was accurate.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20613">Lostchemist</a> — Thu Aug 28, 2014 3:27 am</p><hr />
]]></content>
	</entry>
	</feed>
