Using analog comparator

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
henni
Posts: 16
Joined: Mon Sep 08, 2008 4:17 pm

Using analog comparator

Post by henni » Thu Oct 30, 2008 3:49 pm

What about using the built-in analog comparator of ATtiny and ATmega controllers for detecting true differential signals on D+ and D- wires?
Of course, this will introduce using additional cycles for detecting single-ended states (so, 12 MHz is not sufficient) and another interrupt pin (or the new edge-interrupt on ATmegaX8) for detecting SOF pulses.
This approach should enhance USB standard compliance.

Note that the analog comparator interrupt can be used for detecting the start of transmission, same as D+ routed to INT0 in earlier designs.

What clock frequency is necessary to check the CRC while receiving?

bearing
Posts: 10
Joined: Mon Oct 27, 2008 6:06 pm
Location: Sweden

Post by bearing » Thu Oct 30, 2008 7:28 pm

It may not be fast enough. According to the data sheet the typical propagation delay is 500 ns with VCC 5 V and 750 ns with VCC 2.7V. The bit time of the 1.5 Mbit/s signal is 667 ns.

apollononnno
Rank 1
Rank 1
Posts: 25
Joined: Wed Jul 23, 2008 5:31 am
Location: JAPAN

Level conversion.

Post by apollononnno » Fri Oct 31, 2008 12:18 pm

Only one transistor worked, and it omitted with and a standard voltage was made
resistance division.
A rough voltage is not problem having though the voltage is just good in "3.3/2+0.7"
either.
The clamp voltage is decided by the voltage of LED.

The other is tried in blue LED3.3V, and there seem to be neither
Zenardaiord nor inferiority.
The calculation and resistance are "5V side 27kohm", and "GND side 24
kohm. "
Image
Both tropism conversion I convert a USB level into 5v, and to convert the opposite direction into a USB level.
I simplified it with a transistor as a digital transistor a little.
I added a transistor to blue light-emitting diode (UB1112H) and made a characteristic steep. (It is a voltage source of 2.55v)It is inspection of both tropism.
I work by one circuit, but can distinguish a signal of "D+D-" each if LED 2 has a circuit.
Image

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Tue Nov 04, 2008 12:17 pm

I don't think using the comparator brings an advantage. Signals are usually good enough for direct detection by input ports.

Checking CRC during reception is probably possible at 18 MHz. You need a 256 byte CRC table for that.

Post Reply