hello there, i’m going to university to physics and going to create something really cool. I’ve my programming group, we are all friends and we made software which could easily analyze some scientific data and make it more understandable. this project aims scientist. we have a few users, and i think that if my group would make programmable device, which can be connected to some sensors and send this values to our software running on a PC would be greater, than writing sensor values by hand.
Connection time programming and data transmission form MCU to PC to software isn’t problem, since i know C# pretty well to make this task. I’m interested in technical problems.
- how manage to connect my AVR micro to PC directly, without any additional bridge device, Like atmega8 for atmega328 on arduino. i would like to have chip which would receive some command from PC and in chip would be some ready code to send back to PC sensor value. I’m interested in how to solve this problem.
want to connect this chip where would be predefined program for responding PC commands and some program to make this connection available.
so please help me, I really need your help since i don’t have enough knowledge of microcontrollers.
I'm not 100% sure on exactly what you mean, but, if you want to connect an ATmega to a PC the most common way (i think) is by USB or serial interface.
Most Arduino boards come with a built-in USB.
If you don't want a arduino device, just want to talk to a chip, then you need some kind of bridge. I mean you need to have an interface both the chip and the computer can understand.
I mean, you can put a female USB jack on the same board as the AVR and use that to connect and communicate with the PC.
(I'm really new to this too, sorry if I can't help more).
You can use a chip with built in USB support to talk to the PC. The Leonardo's ATmega32U4 and 1 or 2 of the other boards do that.
You do lose some programming space for the USB support.
If the 32U4 is programmed to acknowledge a command, read the appropriate IO pin(s) and send back the data from that sensor, that would be pretty straightforward.
What would make it more useful would be for the uC to be able to sense whether the requested reading was for a device that was actually connected or not.
you both are right.
I understand that i'll need some space for USB program. as I guess atmega32U4 has it's own interface. I really thought that I'll need some Serial emulator, but I don't know how make this work.
- i'm interested in how make my USB port as Serial port (connecting to it isn't a problem programmatically) and how make chip communicate with it, I think i'll program chip using Arduino.
thank you in advance
I guess from your original Post that you know it is easy to do what you want with an Arduino Uno board.
The first question in my mind is why not go with that, which is a very simple solution and is not very expensive.
I can only think of 2 reasons for a more complex solution that will require hours of your development time. First, the Uno (or any other off-the-shelf Arduino board) can't do what you want; or Second, you intend to make enough of them so that the cost savings would pay for your development time.
In the Open Source spirit of Arduino I suggest that you develop suitable code and instructions for use with an Arduino (both the Arduino code and the PC code) and put it in the public domain. Then all other users have to do is buy a Uno for themselves and install your code.
Purchase a Leonardo, select it in the IDE, and write a normal sketch.
I am pretty sure that:
Comms using Serial.begin() go thru the USB interface,
Comms using Serial1.begin() go thru the UART.
Not nearly as difficult as you are making it out to be.
This is exactly what Arduino is for. There's a reason it's called a "development board". Use Arduino, shields, other parts, etc....to develop your project & get it working. Then, once it works how you want it to & you want to make it permanent (or mass producible, whatever), you can design a single PCB solution that includes everything needed and will work by itself ("standalone").
It kind of sounds like you're trying to put the cart before the horse & design something before developing & prototyping?
I agree with you that Arduino board would be perfect for my project, but there are some drawbacks and i’ll tell you :
first of all I want to make my external device the cheapest one, since we predicted that it won’t be as productive as using Arduino, I mean that my device called X must be cheaper solution, since it would be single-chip(less effective than Arduino, but I need it for specific tasks), and users are going to buy this if it won’t be “expensive”.
in my country it’s not easy to buy Arduino. for example if Arduino costs approximately $20, it would cost in my country $30(transportation and other fees), also our group needs some additional money for “salary”, all in all this isn’t profitable.
if we choose Arduino only few user will buy it from us, since they would be able to buy it itself and use Arduino IDE. this means that our software usage will drop, since they’ll use simple Serial reader. that is beacause our users are hobbists and only ~30% of them is real scientist, who really needs nicely deployed data, arranged and so on. hobbist prefer do it on their own, when there is no need of other fee.
<1> and <2> makes decrease of users of our soft.
so we prefer to make device cheaper, and pre-programed for pre-listed sensors, which means less variety but, we know that it will work.
I agree with you that Arduino board would be perfect for my project, but there are some drawbacks and i'll tell you :
first of all I want to make my external device the cheapest one, since we predicted that it won't be as productive as using Arduino, I mean that my device called X must be cheaper solution, since it would be single-chip(less effective than Arduino, but I need it for specific tasks), and users are going to buy this if it won't be "expensive".
Then I suggest you download the schematic for the Arduino Leonardo and base your design on that, leaving out the bits you don't need.
So make your own breakout board version. Serial.begin and Serial1.begin are still options for you to create the code.
USB, 16 MHz xtal, some jumpers for configurability.
Something like this, perhaps?