Understanding AVR-USB
Understanding AVR-USB
Is it possible to have a microcontroller that basically functions as normal, but can send data to a computer via USB when needed?
For example, is it possible for say, the microcontroller to receive a transmission via infrared, process that data and then send that to the computer. The microcontroller would also take readings from a temperature sensor and send that data to the computer.
Thanks for any help.
For example, is it possible for say, the microcontroller to receive a transmission via infrared, process that data and then send that to the computer. The microcontroller would also take readings from a temperature sensor and send that data to the computer.
Thanks for any help.
Both are possible.. It depends what you want to do.. I mean how much 'non USB' work AVR has to do and how you'll make it work
If 'other jobs' for uC are frequently, then there can be problem with iterrupts (USB host sends packets to device every 1ms as I remember)..
I've had such a problem with my project, finally I've made it on two uC's connected via usart - one for USB, one for IR. You'll get more info and some source here.
If USB communication would be occasional, then it can be done in one chip..
If 'other jobs' for uC are frequently, then there can be problem with iterrupts (USB host sends packets to device every 1ms as I remember)..
I've had such a problem with my project, finally I've made it on two uC's connected via usart - one for USB, one for IR. You'll get more info and some source here.
If USB communication would be occasional, then it can be done in one chip..
GeorgeFace wrote:Great, thanks a lot.
Are you or anyone else able to point me to a good beginner's guide in IR transfer with AVR chips. I don't really understand how to make it work without using the USART.
If you don't need a HID class device, than you can make it on one AVR. Some example (non AVR-USB, author wrote his own driver):
http://www.xs4all.nl/~dicks/avr/usbtiny/. But on host side there must be some software to receive it.
PS. sorry for my english
Question on AVR USB
Hello at all
I have a question on AVR USB:
Is it possible to read also data from a controller over USB
with this projekt or is it only possible to programm a controller??
lg jippi
I have a question on AVR USB:
Is it possible to read also data from a controller over USB
with this projekt or is it only possible to programm a controller??
lg jippi
Re: Question on AVR USB
jippi wrote:Hello at all
I have a question on AVR USB:
Is it possible to read also data from a controller over USB
with this projekt or is it only possible to programm a controller??
lg jippi
Of course it is possible..
The AVRDoper, USBasp and other similar programmers are based on AVR-USB driver (there is AVR uC inside), so they're communicating with PC via USB
Please, see the PowerSwitch project - most basic AVR-USB implementation for example..
Regarding the original question whether the controller can send data to the host or only receive data from the host:
On the physical layer, all data transfers are initiated by the host. If the controller should transfer data to the host, it must be polled in regular intervals. On a logical layer, USB introduces interrupt and bulk endpoints for this purpose. These types of endpoints are polled at regular intervals by the driver, without software intervention.
On the application layer, it looks as if the controller would send data spontaneously to the host. But on the physical layer, the host polls for data regularly.
This is not a limitation of AVR-USB, it's a design concept of USB (all versions of USB).
On the physical layer, all data transfers are initiated by the host. If the controller should transfer data to the host, it must be polled in regular intervals. On a logical layer, USB introduces interrupt and bulk endpoints for this purpose. These types of endpoints are polled at regular intervals by the driver, without software intervention.
On the application layer, it looks as if the controller would send data spontaneously to the host. But on the physical layer, the host polls for data regularly.
This is not a limitation of AVR-USB, it's a design concept of USB (all versions of USB).