Hi, I am designing something similar to the Logitech MXAir, A mouse that works with an IMU. I am planning on using Arduino as my programing language and hardware. Anyways, I have my sensors already done, I have some sensors with their respective circuits already working. Just need an A2D converter (the arduino).
The thing is I want a really small board, but I need at least inputs for 5 fingers + IMU, so the Arduino Mini does not suffice (it only has 4 pinned I/O ports.
So what I was thinking is to incorporate an arduino chip to my breadboard design in Eagle, by just grabbing the ones provided in the Arduino Mini page (the EAGLE files).
I have a couple of questions tho, I was wondering if you guys could help me figure them out as I am no expert in this.
AFAIK the arduino A2D only involves the ATMega328 chip, the crystal and some resistors and the reset switch? (and a voltage regulator that is already in my board)
If this is true, then I was thinking of just copy-pasting the EAGLE files into my board and just deleting the pin-holes and instead connecting them directly to my sensors, would this work?
Can I run the Arduino on 3.3V instead of 5? since the IMU and my sensors run on 3.3V I'd rather have everything running on 3.3 instead of 5.
What other things should I keep in mind when incorporating this into my board? what should I leave open to program the ATMega328, since I am ordering the chip by istelf from Digikey?
Thanks a bunch!
EDIT
BTW I already read the stand alone arduino guide (http://arduino.cc/en/Main/Standalone), It did help me figure out that the basic components are those I listed, but I am still at a loss since I dont want to add that USB board, I want to make this as small as possible.
Do you currently have an Eagle schematic for your circuit?
what should I leave open to program the ATMega328,
You need a 1x6 header for an FTDI cable or the 2x3 SPI header. All these can be found on various official schematics. Plus soem passive components depending on which method you choose.
Honestly if you have Eagle you should be entering the full schematic not dropping PCB files onto each other.
According to me, (thats pretty much my question)
can I just grab the circled part and discard everything else?
my reasoning behind this is that the parts that I crossed out are pin-holes which I will not be using, I will be connecting the inputs directly via the PCB into the chip, my board has DF13 connectors so I dont need pins or pinholes.
Graynomad:
Do you currently have an Eagle schematic for your circuit?
what should I leave open to program the ATMega328,
You need a 1x6 header for an FTDI cable or the 2x3 SPI header. All these can be found on various official schematics. Plus soem passive components depending on which method you choose.
Honestly if you have Eagle you should be entering the full schematic not dropping PCB files onto each other.
Rob
So, which pins are those? because the schematic only has 1x12 (twice) and 2x2, 1x2 and 1x5, none of them seem like the 1x6 you mention., so Im assuming those 6 pins are hidden somewhere in between those 1x12 parts. . .but I don't know which ones are they.
AFAIK the Mini does not have any provision for programming, it comes preburned with a bootloader and it's up to you to connect Rx, Tx and RST to a PC, usually via an FTDI cable which has the 1x6 header I mentioned. I guess you are supposed to have that on your breadboard or wherever but it's not on the Mini.
In your case the bare minimum you need to have connections to is the SPI port and reset, this normally means a 2x3 header and you can get the pinout of that from any of the larger Arduinos. This will use the SPI pins and if possible it's best not to use them for any other purpose although you can if you are careful with what you connect to them.
That will allow you to burn a bootloader and/or also burn your code.
If you do decide to use a bootloader you then also need to implement a connection to the PC, normally as I said that would be using an FTDI cable (FTDI Cable 5V - DEV-09718 - SparkFun Electronics) and the 1x6 header, or you add your own FT232 (or equivalent) chip to do the USB to serial conversion, this is a fine-pitch SMD chip that a lot of people don't like to use.
can I just grab the circled part and discard everything else?
Yes, as long as you have an appropriate 5V power source, plus as I said above you need the SPI connection to program the chip.
Have a look at the Arduino Pro (http://arduino.cc/en/Main/ArduinoBoardPro), see the 1x6-way header on the left, that's the FTDI connector. And see at the other end of the board there's a 2x3 header (not loaded but you can see the holes) labelled ISP, that's the SPI (yes I know, confusingly similar names) connection you need to burn a bootloader.
The Pro may be a better schematic to start with as I think you can just remove stuff rather than having to both remove and add as you have to do with the Mini.
NOTES:
As you can see I included the FTDI 6 pinholes, I have at work a little blue box that connects to the PC on one side and to an FTDI cable on the other, I cant recall the name of the box but we use it to program arduinos.
I changed all the 5V to VCC, they are connected to the power source and voltage regulator (not shown).
The arduino ATMega328P I copy-pasted with all the capacitors/resistors it uses. and the reset switch.
Graynomad:
Yes, as long as you have an appropriate 5V power source, plus as I said above you need the SPI connection to program the chip.
This kind of confused me, do I need the SPI AND the FTDI? or can I choose either? or is one better than the other?
Graynomad:
AFAIK the Mini does not have any provision for programming, it comes preburned with a bootloader and it's up to you to connect Rx, Tx and RST to a PC, usually via an FTDI cable which has the 1x6 header I mentioned. I guess you are supposed to have that on your breadboard or wherever but it's not on the Mini.
the FTDI only has RX and TX, 2 of the pins are grounded, one is for the voltage and the last pin goes to the reset switch, is that the RST? or is the RST some other pin?
Again, thank you for your replies, you've been really helpful and I am excited to finally see this as a tangible board
(the schematic I showed already cleared all the EAGLE problem-checks so if you tell me its good Im having it made over the weekend
DTR is used to reset the CPU, what you have is right.
You need pullup resistors (about 4k7) on the two I2C signals unless they are somewhere else off-board.
You still need the ISP header or you won't be able to burn a bootloader into the chip, once that is burnt you no longer need the ISP header. That's why it was not soldered on the Pro board, they used a temp connection just to burn the BL.
I don't understand the diodes on reset, were they like that on the official schematic?
DTR is used to reset the CPU, what you have is right.
You need pullup resistors (about 4k7) on the two I2C signals unless they are somewhere else off-board.
You still need the ISP header or you won't be able to burn a bootloader into the chip, once that is burnt you no longer need the ISP header. That's why it was not soldered on the Pro board, they used a temp connection just to burn the BL.
I don't understand the diodes on reset, were they like that on the official schematic?
Rob
they are like that on the 328 in the arduino nano, the arduino pro doesnt have the schematics using the 328P, only the 168 which doesnt have enough inputs.
I took it off, I checked other layouts and that diode is only needed when its the 2 legged reset switch that goes to ground, or so it seems
anyways, hers a picture, already error-checked, everything seems nice and dandy
A diode on reset is a recent addition, apparently it was possible to get spikes on that line and the diode clamps them to VCC. But half of the dual diode in the previous schem did nothing as far as I can tell, it was just connected from VCC to GND. That's why I was curious as to where that circuit came from.
You still need pullup resistors on the I2C lines, apart for that you are good to go I think.
Graynomad:
A diode on reset is a recent addition, apparently it was possible to get spikes on that line and the diode clamps them to VCC. But half of the dual diode in the previous schem did nothing as far as I can tell, it was just connected from VCC to GND. That's why I was curious as to where that circuit came from.
You still need pullup resistors on the I2C lines, apart for that you are good to go I think.
Rob
the I2C lines you mean the SCK? the resistor and LED?
or do you mean the TX/RX lines? but those are jumped before the resistors (to the FTDI)
I2C is SCL and SDA, alias A4 and A5. It looks like you are using them for an IMU, so unless that already has the resistors you need to add them to your design.
the TX/RX lines? but those are jumped before the resistors (to the FTDI)
What resistors?
And that's something, what else is connected to Tx and Rx, that might cause a problem with programming.
Graynomad:
I2C is SCL and SDA, alias A4 and A5. It looks like you are using them for an IMU, so unless that already has the resistors you need to add them to your design.
the TX/RX lines? but those are jumped before the resistors (to the FTDI)
What resistors?
And that's something, what else is connected to Tx and Rx, that might cause a problem with programming.
Rob
other than the FTDI I have the TX/RX connected to a 3.3v 915Mhz Radio transmitter. should I add those resistors then?
I repeat, what resistors, there are none on the schematic? Do you mean the 1k ones used on many Arduinos to isolate pins 0 and 1 from the FTDI chip?
It's not normally a great idea to have devices share a serial port, although the limitations of the 328 often force people to do that.
If you do share will the RF module be happy seeing all the programming crap that appears on the serial line when downloading? And how will you debug your program with no access to the serial port because it's already being used by the RF module.
3.3v 915Mhz Radio transmitter
Just noticed it's 3v3 as well, if it's not 5v tolerant you have to reduce the voltage on Tx to ~3v3.
EDIT: You did ask about running on 3v3, yes that can be done but not really at 16MHz, IIRC about 12MHz is as fast as they spec for that voltage.
For the I2C you can simply pull up to 3v3 instead of 5v.
Graynomad:
I repeat, what resistors, there are none on the schematic? Do you mean the 1k ones used on many Arduinos to isolate pins 0 and 1 from the FTDI chip?
It's not normally a great idea to have devices share a serial port, although the limitations of the 328 often force people to do that.
If you do share will the RF module be happy seeing all the programming crap that appears on the serial line when downloading? And how will you debug your program with no access to the serial port because it's already being used by the RF module.
3.3v 915Mhz Radio transmitter
Just noticed it's 3v3 as well, if it's not 5v tolerant you have to reduce the voltage on Tx to ~3v3.
EDIT: You did ask about running on 3v3, yes that can be done but not really at 16MHz, IIRC about 12MHz is as fast as they spec for that voltage.
For the I2C you can simply pull up to 3v3 instead of 5v.
Rob
Yes I am running the AT328 on 3.3V instead of 5V, my whole circuit runs on 3.3V so might as well change the arduino to 3.3
according to this guide it should be able to run on 3.3v with the 16Mhz crystal, from what I've read it works, so im going with that.
I was looking at various schematics of multiple boards that use the AT328P and only some have those resistors you talk about (the one in the RX/TX) the only one that is consisten in all o them (which I added on mine) is the one on the SCK.
I was thinking of just adding two 100 Ohm resistors (TX/RX) just for current spike safety, do you think that would do the trick?
ABOUT THE RF TRANSMITTER:
it is connected by a physical cable, its not incorporated into that particular PCB. it goes from a DF13 connection to this board.
So If I connect the FTDI I wouldnt connect the RF to it, it would be solely the FTDI or the ISC connection to program the chip, and then after I program it I connect it to the radio so I can get my wireless readings. The radio is already configured and working with other arduino boards, but this is a different project
should be able to run on 3.3v with the 16Mhz crystal, from what I've read it works, so im going with that.
Yes people do and it does work, but I think it's out of spec. It's hard to tell because the diagram in the data sheet is crap.
the only one that is consisten in all o them (which I added on mine) is the one on the SCK.
I'm confused, the only resistor normally on SCK is a current-limiting resistor for the LED, you circuit has neither a resistor nor a LED.
I was thinking of just adding two 100 Ohm resistors (TX/RX) just for current spike safety, do you think that would do the trick?
Series resistors? Yes that won't do any harm and can protect the pins a bit. If you are really worried about this sort of thing some TVS diodes wouldn't go astray.
So WRT the the serial connections, if you are happy to remove the RF and add the FTDI, program the chip, then swap back again every time then what you have is OK. It will get pretty tiresome pretty quick I think but that depends on how often you have to program the chip. Personally I've never got anything running in less than 100 programming iterations
But the other issue is, how will you debug your code with no serial port?
Just for fun I thought I'd improve the crappy "speed vs VCC" diagram in the 328 data sheet.
As you can see at 3v3 the chip is only spec'd at just over 13MHz, as has been noted people often run them at 16MHz and that's ok as long as it isn't a commercial product, especially if it will be subject to large temperature variations.
Graynomad:
But the other issue is, how will you debug your code with no serial port?
Rob
well I am not trying to program much into the arduino itself. here is what I plan to do:
Make the arduino just an A2D converter, from what I've read and asked its the simplest way to do it, given all the support in the internet (other a2d chips have circuits that go with them and the support is minimal or non-free)
I have my sensors already working with their respective signal processing circuits, analog output.
Analog output -> A2D Arduino -> RF Transmitter -> RF Receiver -> USB -> PC -> do something with that data.
I want the PC to do something with the data, not the arduino itself, its not going to have outputs at all, as mentioned im only using it as an A2D converter