Page 1 of 1

Somewhat desperat for a "hello world" from uC to h

Posted: Sun Feb 25, 2007 6:47 am
by kyron
Hello everyone, I have been reading almost all of the provided reference examples on the avr-usb site to grasp the proper use of the avr-usb library. Unfortunately, the basics still seem to elude me.

Here is the simple application I want to make of AVR-USB: I have 4-20MA sensors (level and temp) which need to be read at a regular interval and log the data onto a server. The RemoteSensors receiver circuit seems like a good starting point but I am getting somewhat lost in all the array mish-mash and intricate loops. I guess that once I will have read/made my own project all of this will become rather obvious.

Could someone point me to simple modifications I could make to the receiver.c so that, instead of reading from the RX module, I would simply be reading from the ADC (one might make a neat, cheap, 8 channel USB Oscilloscope out of this :P). I guess that what I am really looking for is some sort of "how to send data to the host and have a daemon catch it" simple example.

Here is the modified Eagle schema for what I am trying to accomplish. Please do excuse my clumsy use of Eagle for I have only used it since....yesterday ;)

The hardware I have to program/dev is:
STK500v1
Atmega8
And all the relevant electronics to put it all together...hopefully.

Some notes:
-The proposed fuse bits from the RemoteSensor screwed ISP programming (for me that is...)
- I am attempting to use a diode since my supply voltage is 5V
- The receiving host is Linux, so no Windows bother and worries here ;)

Re: Somewhat desperat for a "hello world" from uC

Posted: Tue Feb 27, 2007 12:22 am
by watz
If you need help on the software part (uC and/or host) I could fiddle together some C example for you from the little project I am currently working on. I have successfully build my own avrusb device using usb control messages together with libusb to exchange data with the host. It is actually quite simple to do and should work on linux, too.

Re: Somewhat desperat for a "hello world" from uC

Posted: Tue Feb 27, 2007 11:09 pm
by Guest
watz wrote:If you need help on the software part (uC and/or host) I could fiddle together some C example...


Thanks but I managed. My first mistake was to not read the USB specs and expect to understand the API. Once I read it, I could understand what I was doing in the configusb.h.

I heard there were some "Hello World" examples on avrFreaks but I didn't think of looking there at the time. All in all, I finally got something going and will probably post my rather simple circuit publicly as well as a "hello world" example I guess ;)