Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: atmega328p - fuse settings to ensure brown out detection at 2.7v on: March 06, 2011, 06:03:18 pm
thanks, coding badly.  very helpful.  ben
2  Using Arduino / Microcontrollers / Re: atmega328p - fuse settings to ensure brown out detection at 2.7v on: March 06, 2011, 05:37:49 pm
I cut and paste the wrong section from boards.txt.  The current settings are:
pro328.bootloader.low_fuses=0xFF
pro328.bootloader.high_fuses=0xDA
pro328.bootloader.extended_fuses=0x05

Does that help with an answer?

Ben
3  Using Arduino / Microcontrollers / atmega328p - fuse settings to ensure brown out detection at 2.7v on: March 06, 2011, 03:46:12 pm
So, I've bootloaded my atmega328p with a suitable 3.3v 8MHz bootloader (ATmegaBOOT_168_atmega328_pro_8MHz.hex).  It works fine.  But I am about to run the chip from a 3.7v lipo (hence this new bootloader) and I want to make sure it has BOD at 2.7v.  I have googled around this, but can't at the moment find the answer to this question: what should the fuse settings be to have BOD at 2.7v?  Or how do I work the answer out?  (I have looked at http://www.engbedded.com/fusecalc/ but I cannot make head/tail of it).

The current settings (from the boards.txt file) are:
diecimila328.bootloader.low_fuses=0xff
diecimila328.bootloader.high_fuses=0xdd
diecimila328.bootloader.extended_fuses=0x00

Thanks in advance,

Ben
4  Using Arduino / Motors, Mechanics, and Power / regulating 3.3v from a lipo for this set-up on: February 22, 2011, 04:56:02 pm
My project has an atmega328 (arduino-programmed) controlling two stepper motors, displaying position information on an lcd, and receiving instructions from a matrix keypad and over bluetooth from a laptop.  It all works like a treat at 5v and i have now swapped in the components needed to run at 3.3v (the 'arduino' is an arduino-programmed atmega328 running at 3.3v and 8MHz, a new lcd runs at 3.3v, and the bluetooth module needed no change).  It all works fine...

Now I want to power this system by a lipo cell (hence the change from 5v to 3.3v) and i have purchased a 6AH 3.7v lipo from sparkfun.

My question is this: given that the stepper motors draw about 800mA-1Amp total when they are both moving at the same time, and the rest (the atmega + LCD + bluetooth + matrix keypad) draws up to 150mA, how should I best regulate the output voltage from that lipo cell? 

Option 1: have no voltage regulator at all - would this be OK?  I suppose I should have some sort of under-voltage protection though but I'm not sure how to achieve that.

Option 2: Get a low drop out 3.3 voltage regulator – but I cannot find any that will handle the sort of current I have here.  It also seems pretty inefficient.

Option 3: have no voltage regulator for the stepper motors (which can happily operate up to 5v and would not be damaged at low voltages) but then regulate the atmega and all the other components.

Option 4: Some sort of ‘buck-boost’ system (like the one from SparkFun – link below) but again due to the current draw I would only be able to have that wired up to the atmega + components, the steppers would have to be unregulated.  Would that be OK?

Thanks in advance,

Ben

http://www.sparkfun.com/products/10300
5  Using Arduino / Motors, Mechanics, and Power / stepper motor - battery drain when unused? on: February 17, 2011, 05:14:22 am
Quick question:
- how much quicker (if at all) will a 6AH lipo cell discharge if it is permanently connected to an idle stepper motor?

I bascially have two alternatively design scenarios:
A.  cell permanently disconnected from stepper motor and then plugged in when needed - which I presume will keep the battery life for longer.  I should say that the cell provides power to the stepper alone, a separate circuit provides power to the arduino which is controlling it.  
B.  cell permanently connected to stepper motor but without the stepper being used (because the separate circuit to control the stepper is off).

Is 'B' likely to lead to much quicker discharge of the cell - becasue all those coils in the stepper will increase its discharge rate, or will it not make much difference?

I have, of course, thought about just experimenting with this, but a 6AH cell left to discharge is going to be a lengthy experiment.  

thanks in advance.

ben
6  Using Arduino / Project Guidance / change 5v breadboarded arduino (atmega 328) to 3.3v on: January 29, 2011, 01:53:55 pm
my current set-up is an atmega 328 (formerly on an arduino diecimilia) running on 5v on a breadboard (using tom igoe's tutorial).  I use an FT232R breakout board to upload sketches to it.   I now need to drop the set-up down to 3.3 volts for various reasons.  My checklist of things to do (and my present answers) are as follows:
1.  get clean 3.3volts: use a 3.7 lipo from sparkfun and the latest sparkfun 'power cell' which has a nice TPS61200 Buck/Boost Converter.
2.  Doing 1, means that I can get rid of the 5v voltage regulator (and capacitors associted with it).
2.  Change the 16MHz crystal to an 8MHz crystal.
3.  Change the wiring of the FT232R breakout board so that it runs at 3.3v
4.  Load the same sketch as before onto the chip from within the arduino software but this time select 'arduino pro at 3.3v at 8MHz'.

Am I missing something? 

Thanks in advance,

Ben


7  Forum 2005-2010 (read only) / Syntax & Programs / Re: can you amend a global variable within a library? on: December 27, 2009, 06:15:38 pm
Thank you both very much indeed.  Sorted it out from your responses.  All very helpful and Ben gets the medal of honour for the alternative solutions.

If anyone else stumbles across this, alongside the links above the most useful 'pointers' i found (my first c++ pun) were:
1.  http://en.wikipedia.org/wiki/Pointer_(computing) which had a super useful and easy explanation and,
2.  http://www.arduino.cc/playground/Code/Pointer which was pithy but got me to it.

Ben
8  Forum 2005-2010 (read only) / Syntax & Programs / can you amend a global variable within a library? on: December 27, 2009, 01:43:16 pm
I am writing a library which can run 2 stepper motors.  so, instead of step (200), you send the instruction step(200,100).  All fine.  But there are occasions when the stepping will be cancelled part way through, say after 100 steps of motor 1 and 50 steps of motor 2 (they run synchronously).  i need to be able the library to report back both results: 100 done on stepper 1 and 50 done on stepper 2.  

Becuse there are two results to be passed back I can't use the usual 'return' method because I can't return two results.  (I could of course send a single result in a string but that's messy.)  

So instead I thought about amending two global variables that are created by the sketch but can i do this?  nope.  Any ideas?  

Thanks in advance,

Ben
9  Forum 2005-2010 (read only) / Syntax & Programs / unsigned longs and doubles - quick question on: April 20, 2008, 06:40:47 am
I have a variable (called delay) that is currently "unsigned long".  It's from the stepper motor library.  i want to increase that variable in a loop as follows:

start loop:

delay = delay + 0.0054

back to top.

I am getting very funny outputs.  I know (I think) that unsigned long will not handle the 0.0054 value so what should I do?  Should i change delay into a "double" variable?  But how many decimal places will that work for.  The fact is that I know the delay will not "in fact" increase by a fraction of a millimeter, but I want the value to increment at that fraction.

Sorry, I know that this is an easy question, but not much help out there on this...

Thanks,

Ben
10  Forum 2005-2010 (read only) / Troubleshooting / Re: arduino power difference: battery laptop and mains on: October 13, 2010, 04:45:24 pm
RuggedCircuits, you got me onto the solution.  If the ground is shared between the arduino and the pc then all works fine (regardless of whether running on battery / mains).  Thanks, Ben
11  Forum 2005-2010 (read only) / Troubleshooting / Re: arduino power difference: battery laptop and mains on: October 13, 2010, 04:37:16 pm
Thanks, GrumpyMike, I can go down that route but what is strange to me is that my present approach does work when the laptop is running off mains.  The IR receiver takes a minimum amount of current and, as I say, it works like a dream when the laptop is powered from the mains, but as soon as the latop switches to battery power no joy.  (Sony laptop, vaio, btw).

Ben
12  Forum 2005-2010 (read only) / Troubleshooting / Re: arduino power difference: battery laptop and mains on: October 13, 2010, 04:32:18 pm
Thanks, RuggedCircuits, I did that already but no joy (ie I ran ground to the PC and not the arduino).

Normally, the IR receiver which has three pins gets 5v in on pin3, ground is pin2, and pin1 carries the 'message'.  The normal set up is that the PC provides the power and ground and 'waits' receive a message on pin1.  I am basically 'hijacking' it by providing power and ground via the arduino but still sending the 'message' back to the PC.  As I say, this works when the arduino is powered by a laptop on mains supply.  It doesn't work though when the laptop is running on battery power.  

Ben
13  Forum 2005-2010 (read only) / Troubleshooting / Re: arduino power difference: battery laptop and mains on: October 13, 2010, 03:50:24 pm
hmm, well spotted.  my use of the word 'power' betrays my ignorance.  The practical effect of the problem is a little hard to describe but I shall try:

I have a PC with a remote and an IR receiver.  Its most useful function is that by using the remote I can turn on the PC.  Now, the arduino comes in to the equation because I don't want the IR receiver to be 'receiving' all the time.  Instead, I want it to 'receive' when the arduino tells it to (for reasons that are too convoluted to go in to).  So, the sketch and wiring is simple: on a certain condition turn Pin 4 high.  Pin 4 is used to send 5v to the IR receiver (ground returns back to the arduino).  But then, the third leg of the IR receiver (which actually contains the 'message' from the ir receiver) does no go back to the arduino but to the PC.  So the effect is that of the 3 pins of the IR receiver two (5v power and ground) are wired to the arduino while the 3rd (the pin holding the 'message') goes back to the PC.  

Strange thing is, this rig works when my arduino is running on power from the USB and the laptop is running on mains power.  The PC turns on and off and the remote controls the PC even though the IR receiver is getting its power from the arduino and 'reporting' its results to the PC.  BUT, when I run the laptop on battery (or use a 9v mains supply) the rig no longer works.  There is clearly some 'power' going to the IR receiver but seemingly not enough to 'power' the IR receiver.

Does that help or hinder?

Thanks,

Ben

14  Forum 2005-2010 (read only) / Troubleshooting / arduino power difference: battery laptop and mains on: October 13, 2010, 03:27:39 pm
Weird: when i have the arduino attached by USB to the laptop, and the laptop is powered by the mains, i get more power from my 5v output on the arduino board (duemilenova) than if the laptop is just running on battery power.  What is more, the same 'lower power' is happens when I run the arduino from a 9v power supply.

Any ideas?

Thanks,

Ben

15  Forum 2005-2010 (read only) / Interfacing / lcd: concat string then print, or print multiples? on: January 27, 2010, 05:43:35 am
I have a serlcd from sparkfun.  I need to send data that ends up like this (ie degrees, mins, secs):
359d 34m 23s
Which is more 'effecient':
A.  concatenate a string programmatically ie: string = degvar + "d" +minvar + "m" + secvar + "s". (also need to include leading zeros) And then print that string to the LCD.
OR
B.  print each variable at the correct location on the LCD:
print (at location 0) degvar
print (at location 6) minvar
print (at location 10) secvar

The timing is critical because the LCD is reporting the movement of a stepper motor which at its fastest rate only has 10ms between each step - so I don't want the stepper to be interrupted by the reports to the lcd.  

I should add perhaps that I presume I would transmit to the lcd at 9600 baud and would only be sending values every 100ms or so (ie not every step but every 10 steps or so).

Many thanks in advance.

Ben

PS I recognise that I could test this out experimentally but wondered if there was an obvious answer...
Pages: [1] 2