Show Posts
Pages: 1 ... 62 63 [64] 65 66 ... 116
946  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 09, 2012, 11:32:06 am
Put the tiny folder in the usual place (under the hardware folder). Then move the contents of the tiny folder into a subfolder named 'avr'. So for example my tiny files are located at:

...\arduino-1.5\hardware\tiny\avr

Then, copy the "platform.txt" file from:
...\arduino-1.5\hardware\arduino\avr\platform.txt
To:
...\arduino-1.5\hardware\tiny\avr\platform.txt

And voila, that should be all it takes. Restart the IDE and away you go.

The good news is that my fix for tiny85's and tiny84's to prevent errors when the compiled size is greater than 4kB still works in Arduino 1.5.1:
https://github.com/TCWORLD/ATTinyCore/tree/master/PCREL%20Patch%20for%20GCC
947  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 09, 2012, 07:02:11 am
I got it working fine with 1.5.1. I will post where I put everything this evening.
948  Using Arduino / LEDs and Multiplexing / Re: RGB SMT LED Cube, resistors, drivers, and shift registers. on: November 05, 2012, 04:31:35 pm
The middile one definitely has something wrong. You don't use a resistor potential divider as a power supply [unless you use a power op-amp to prevent (make negligible) the effects of loading, but that is a whole other kettle of fish].
You should use a proper voltage regulator - be it a LDO regulator, a switching regulator, a zener diode, or other such voltage regulation devices

Loading 101:

If say for example you have two 1k resistors as a divider and say connect 5v at the top. Under no load, you will get 2.5V. Say you now used that as a power supply, and started drawing i dont know, maybe 1mA from the 2.5V line

You would then have
 Ib = Vb/Rb = Vb/1000 [A] flowing through the bottom resistor, and 1mA flowing through the output.
That would then mean that flowing through the top resistor you have:
 I = 1 + Vb [mA] = 0.001 + 0.001Vb [A]
The voltage drop on the top resistor would then be:
Vt = IR = 1000*I = 1 + Vb [V]
That would give you a total voltage drop across the potential divider:
 V = 5[V] = Vt + Vb = 1+2Vb

So that would mean that at the output, the voltage would be:
 Vb = (5 - 1)/2 = 4/2 = 2[V]

So in that case, just 1mA of loading would result in the output voltage dropping by 20%.


In your case you seem to be using 10k for the lower resistor and 5k for the upper resistor and are attempting to power 3 LEDs from it. So input voltage would be 5V, load current would be say 60mA. So just for fun that would give Vb = -200[V]. That figure is of course absurd, and the reason for it is you simply cannot put 60mA through a 5k resistor when the voltage across it is limited to 5V (The maximum would be I=V/R = 5/5000 = 1[mA], and at that amount there would be 0v across the LED).
949  Using Arduino / Programming Questions / Re: Interrupts cli() & sei() on: November 03, 2012, 07:48:55 pm
They are the same:

Courtesy of Arduino.h:
Code:
#define interrupts() sei()
#define noInterrupts() cli()
950  Using Arduino / Displays / Re: Nokia-SPI-LCD (Help required) on: November 03, 2012, 02:34:42 pm
This might seem daft, but that LCD appears to be one of those which is compatible with the Nokia6100 display.

In which case the library I wrote for the 6100 should work with this display:

https://github.com/TCWORLD/gLCD-Library
951  Using Arduino / Programming Questions / Re: Attach Serial Monitor to Another Line? on: October 30, 2012, 07:20:26 pm
*If* you have a second USB-Serial converter, and *if* you then connected it to RX1 and TX1, then you could simply select the com port of this second port in tools->serial port. Then when you open the Serial monitor you would see messages coming out of and could send data to "Serial1".

If you don't have a second converter (or a third or a fourth), then you are stuck with the onboard one which is physically (and permanently) wired to RX0 and TX0. As a result you can only see messages from "Serial". This is due to hardware connections not the IDE. Serial sends data out of RX0, Serial1 sends data out of RX1, Serial2 from RX2, Serial3 from RX3. If these are not connected to the computer, how can you see anything from them in the serial monitor?
952  Using Arduino / Programming Questions / Re: Data type confusion on: October 30, 2012, 07:14:40 pm
You are usingchanging bufPos and buf[] inside an ISR so they should be declared volatile:

Code:
volatile char buf [100];
volatile byte bufPos;

By declaring them as such, the compiler knows they can change at any time (because of an interrupt).
If you don't it doesn't know about the interrupts, sees 'bufPos' as Zero when it gets to the main loop (it is set as such at the end of setup) and decides "if (bufPos > 0)" will thus never be true as bufPos cannot as far as it is aware change, so it optimises it out.
By adding the Serial.print() statement to the loop, it has to read in bufPos from the SRAM to print it, and for all it knows the print() function could affect bufPos. The result is it cannot gaurantee that the value doesn't change, so the if statement doesn't get optimised out.

Declaring them as volatile should fix the problem.
953  Using Arduino / LEDs and Multiplexing / Re: RGB SMT LED Cube, resistors, drivers, and shift registers. on: October 30, 2012, 06:20:05 pm
The way I have made mine structurally sound is to use a plastic frame, but I have access to a laser cutter at the University where I study so that may not be an option. The other thing I considered doing was to use plastic rod which can be gotten from hobby shops, and then either glue or melt the layer wires into it to give it rigidity.

What values of resistor do you have available? If you have enough 3.3k resistors, you can put two in parallel to get 1.65k which would give you exactly 3.3V. Alternatively any three resistors of the same value with the top of the potential divider being two in parallel will result in 3.3V

Code:
o-----+--+
      |  |
    R [] [] R
      |  |
      +--+-----o
      |
    R []    Where R = any value - preferably between 1k and 10k
      |
o-----+--------o
954  Using Arduino / LEDs and Multiplexing / Re: RGB SMT LED Cube, resistors, drivers, and shift registers. on: October 30, 2012, 01:30:52 pm
1.8k and 3.3k tend to work well. 
955  Using Arduino / LEDs and Multiplexing / Re: RGB SMT LED Cube, resistors, drivers, and shift registers. on: October 30, 2012, 11:50:26 am
What I am saying is that when you disconnected the 5V line, it stayed working because there are diodes built into the chip. This is a very bad way of operating the chip.


When you connected 3.3v, you need to level shift signals from 5v down to 3.3V otherwise there will be excessive currents flowing through the same built protection diodes which will damage the chip.

Level shifters can range from dedicated IC's to Transistors, to basic resistor potential dividers.
956  Using Arduino / LEDs and Multiplexing / Re: RGB SMT LED Cube, resistors, drivers, and shift registers. on: October 30, 2012, 04:43:40 am
Clamping diodes on the inputs of the shift register IC. Basically if you remove Vcc, power can flow from an input which is set at logic 1 to Vcc via the protection circuits. This is not good for the IC as the protection circuits aren't designed to power the thing.
If theArduino is running at 5V still you also have a problem as you are running the shift register at 3.3v meanung that the inputs will be far above the absolute maximum allowed voltage of Vcc+0.5V
957  Products / Arduino Due / Re: pgmspace.h is not supported? on: October 30, 2012, 04:09:06 am
If you put it in the folder I suggested, you can just use:

#include <avr/pgmspace.h>
 
to include it in your library, meaning you can use the same stement for both due and avr.
958  Products / Arduino Due / Re: pgmspace.h is not supported? on: October 29, 2012, 07:59:34 pm
That works well if you put it in the folder:
Code:
<Arduino Dir>\hardware\arduino\sam\libraries\avr\avr\

One query though, aren't you missing the const keyword? In which case surely everything gets stuck in the RAM, or have I missed something.

In which case should you define 'PROGMEM' as 'const'
#define PROGMEM const
I suppose the problem with that is if people put the PROGMEM term after the variable name in which case it wont work.
959  Using Arduino / Programming Questions / Re: Can not get a scketch to upload using xbees. on: October 28, 2012, 02:02:20 pm
I don't think they can, i think they have to be read locally.
960  Using Arduino / Programming Questions / Re: Can not get a scketch to upload using xbees. on: October 28, 2012, 12:42:16 pm
I thought the auto reset would work as the newer boards have this built in.
again thanks for your input.

They do, but it is part of the USB-Serial converter built in. If you are using xBees, then I presume you are bypassing this?

Maybe you could do a quick sketch of how you have wired the xBee to your board.


Also, you said you tried changing the Baud rate? This is programmed into the xBees as well as the bootloader, so if one of the xBees is 30feet in the air, how did you set it to the faster 57600 baud rate required?
Pages: 1 ... 62 63 [64] 65 66 ... 116