Show Posts
Pages: 1 ... 62 63 [64] 65 66 ... 116
946  Using Arduino / Microcontrollers / Re: Arduino Tiny on: November 10, 2012, 06:20:19 am
Oh right yeah forgot that. You have to now specify the upload tool in the boards.txt file.

To do that you need to add these lines for each entry:

attiny84at1.bootloader.tool=avrdude
attiny84at1.upload.tool=avrdude


Also, if you haven't already got one, you may have to copy the programmers.txt file from the arduino folder as well. I am not sure that this is needed though as it results in duplicate programmers in the IDE programmer window.
947  Using Arduino / Microcontrollers / Re: ArduinoISP Fuses Only. on: November 09, 2012, 06:49:01 pm
avrdude in conjunction with Arduino Uno flashed with ArduinoISP should be able to change the fuses after a bootloader or some other hex file has been uploaded to the target Attiny.

Yup, thanks for that smiley I totally forgot about using avrdude as a standalone.

This worked:
avrdude -CE:\~Path~Removed~For~Security~\arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny84
-cstk500v1 -P\\.\COM4 -b19200 -U hfuse:w:0x57:m


Rather pleasingly the blink sketch I uploaded to check with continued blinking away after avrdude finished smiley

Edit:
Just checked and the bootloader is still functioning properly. I have to remember to do a power cycle just before the program starts to download to get back into the bootloader, but that was to be expected. Bye bye autoreset smiley
948  Using Arduino / Microcontrollers / ArduinoISP Fuses Only. on: November 09, 2012, 06:26:57 pm


I need to program an ATTiny via ISP with a bootloader, and then rewrite the fuse settings to disable the reset pin functionality.
The problem is that it appears to erase the flash, then write the fuse settings, then write the bootloader code. This means that if I set the fuse such that it disables the reset pin, then it cannot write the bootloader as suddenly ISP becomes not possible.
 I thought then if I burn the bootloader with the fuses set to have the reset pin enabled (that gets the bootloader code successfully onto the chip), then run the burn bootloader process again only this time with a fuse setting which disables the reset pin, then all would be well. The bootloader would remain from the first pass and the fuse settings from the second. However it would appear that the bootloader written by the first pass is erased in the second meaning I am left with a tiny with no bootloader and no reset pin (= need a high voltage programmer to recover it).

Does anyone know if it is possible to get the ArduinoISP sketch to only change the Fuse settings without modifying the flash?
Or failing that is there a way to change the order of things and make it fuse-erase-write instead of erase-fuse-write.
949  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
950  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.
951  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).
952  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()
953  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
954  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?
955  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.
956  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
957  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. 
958  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.
959  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
960  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.
Pages: 1 ... 62 63 [64] 65 66 ... 116