|
844
|
Using Arduino / Motors, Mechanics, and Power / Re: How to release stepper motor
|
on: February 16, 2012, 05:15:06 pm
|
|
Depending on how you driver is wired - you could put a transistor parallel to a resistor on the voltage supply to your driver and turn the transistor on when you are moving and turn it off when you are stopped. The resistor would have to be sized for both the holding current and for the heat it would have to get rid of. You would need a high wattage resistor.
|
|
|
|
|
845
|
Using Arduino / Project Guidance / Re: arduino and ham radio beacon
|
on: February 16, 2012, 04:55:58 pm
|
|
Does that radio have an AM mode? Does the radio key fast enough that you could use an unmodulated AM carrier for yur beacon? (That's all CW is anyway.)
Problem with either method is going to be getting a proper impedance match between the Arduino Audio and the Radio Audio. A capacitor might do, or you might need a small audio transformer to isolate them.
Finfd out how much (or how little) current you are switching in teh PTT circuit. You might be able to get away with something as simple as a 2N2222.
|
|
|
|
|
847
|
Using Arduino / General Electronics / Re: power still on when removing the usb
|
on: February 15, 2012, 01:42:21 pm
|
Okay - by the board has a 12v external power connector which i have hooked up to my power supply. do yu mean that you connected the 12V supply for the external realy card to the power supply input on the Arduino board? If so, that is what that connector is for and 12V will work fine in this application. The regulator on the Arduino board might warm up a bit, but it is just doing its job.
|
|
|
|
|
848
|
Using Arduino / Installation & Troubleshooting / Re: bootloading raw 328
|
on: February 15, 2012, 01:25:58 pm
|
|
It works, I have used the ArduinoISP(loaded under Arduino-0.22) to program ATMega328's and ATtiny2313A's.
Make sure you have all the correct connections, the device 00 00 00 sounds like you are missing power to the device to be programmed.
Are both devices tied to a common ground?
Do you have Crystal or Resonator connected to the chip you wish to program?
You can type something like this from the command line to check your programming connections - avrdude -P comport -b 19200 -c arduino -p m328 -v
Just change the comport to com4 or com9 or whatever comport yours shows up as.
I had to program using AVRDude because my chip was a 328 and not a 328P
|
|
|
|
|
849
|
Using Arduino / Motors, Mechanics, and Power / Re: Arduino chip as Stepper Controller
|
on: February 14, 2012, 10:00:23 pm
|
I got it working - Figured out what was lacking in my assembly code and now it works. .NoList .INCLUDE "tn2313Adef.inc" ; Header for ATTINY2313A .List ; ============================================ ; R E G I S T E R D E F I N I T I O N S ; ============================================ .DEF Conf = R16 ; Multipurpose register .DEF StepCt = R17 .DEF StepMask = R18 .DEF Direction = R19 .DEF PortBHold = R20 .DEF PortDHold = R21 .DEF PortDMask8 = R22 .DEF SeqBase = R24 ; ============================================ ; S R A M D E F I N I T I O N S ; ============================================ .DSEG .ORG 0X0060 ; ============================================ ; R E S E T A N D I N T V E C T O R S ; ============================================ .CSEG .ORG $0000 rjmp Main ; Reset vector rjmp Step ; Int vector 1 reti ; Int vector 2 reti ; Int vector 3 reti ; Int vector 4 reti ; Int vector 5 reti ; Int vector 6 reti ; Int vector 7 ; ============================================ ; I N T E R R U P T S E R V I C E S ; ============================================ Step: in PortDHold,PIND ; look at only PD#, the Direction input and PortDHold,PortDMask8 ; if PD3 High, Add Direct to StepCt, if PD3 Low Subtract Direction breq SinNeg add StepCt,Direction rjmp Next SinNeg: sub StepCt,Direction ; limit StepCt to range from 0 to 7 (-1 becomes 7) Next: and StepCt,StepMask ; use Z as a pointer to the StepSequence table mov ZL,SeqBase ; StepCt is teh offset into the table add ZL,StepCt ; transfer the next bit pattern from ProgMem to PortBHold, R20 Lpm PortBHold,Z out PortB,PortBHold reti ; ============================================ ; M A I N P R O G R A M I N I T ; ============================================ Main: ; Init stack ldi Conf, LOW(RAMEND) ; Init LSB stack out SPL,Conf ; Init Port A ldi Conf,0 ; Direction Port A out DDRA,Conf ; Init Port B ldi Conf,(1<<DDB0)|(1<<DDB1)|(1<<DDB2)|(1<<DDB3) ; Direction Port B out DDRB,Conf ; Set ISC00 to 0 and ISC01 to 1, Falling Edge INT0 Interrupt ldi Conf,(0<<ISC00)|(1<<ISC01) out MCUCR,Conf ; Set INTO , Bit 6 of GIMSK to Enable INT0 ldi Conf,(1<<int0) out GIMSK, Conf ; Initialize StepCt, R17 ldi StepCt,0 ; Initailize StepMask, R18 ldi StepMask,7 ;Initialize Direction, R19 ldi Direction,1 ; Initialize SeqBase to point to 8 bit address of StepSeq ldi SeqBase, StepSeq add SeqBase,SeqBase ; Initialize PortDMask8, R22, to mask only PD3 of port D ldi PortDMask8,8 ldi ZH,0 sei ; ============================================ ; P R O G R A M L O O P ; ============================================ Loop: rjmp loop ; go back to loop ; bit patterns for output to the Stepper Drive Bits. StepSeq: .DB 1,3,2,6,4,12,8,9,0,0 ; End of source code
|
|
|
|
|
850
|
Using Arduino / General Electronics / Re: [QUESTION] - Transistor layout or rather in code - General circuits
|
on: February 14, 2012, 12:28:26 pm
|
|
Sometimes it is cheaper (both money & time) to implement something in hardware, sometimes in software. Sometimes it is more efficient to implement in software, sometimes in hardware. It might be simpler to add another AVR or ATtiny chip to a design and create anadditional function in software. A hardware solution might not cost much less, and the software solution might be more flexible.
An 8 pin ATtiny might work just fine for a couple debounced switch inputs, and maybe one of them is a on/off toggle. And then in the next applicatin you need 2 on/off toggles... Just a quick code change.
I am using some ATtiny2313's programmed to accept Step & Direction inputs and output the 4 phases for driving stepper motors. I could do the same thing with chips and wires, but programming the 2313's seemed to be quicker and cleaner, and I can select several different output modes. 2 inputs, 4 outputs to the transistors and its clean, neat and relatively simple. A dedicated 2313 and the code was developed on an Arduino. I still need to add some enable inputs and a ready output and...
A microcontroller is just a bunch of gates that you get to connect with code rather than copper...
|
|
|
|
|
854
|
Using Arduino / General Electronics / Re: Question about AREF to GND
|
on: February 13, 2012, 02:06:45 pm
|
I'm going to be using an analog pin to also read a thermocouple and wheatstone bridge from a strain gauge, so I'd like them referenced to ground instead of 1.1v.
To provide a ground refernce you tie the external devices ground to the Arduino ground. UIf you don't tie the grounds together, they are floating relative to each other and no reading will make any sense.
|
|
|
|
|
855
|
Using Arduino / General Electronics / Re: Question about AREF to GND
|
on: February 13, 2012, 02:04:03 pm
|
|
You would never want to tie AREF to ground. It is used to compare with your analog inputs to determine what value they should have. If you Max Valkue from you analog devices was 4V then you would want to use 4V for your analog ref.
The other problem is that your analog input is just floating when 5 vols is not connected. What is it going to float to? It would appear that it is floating to 5V. You need to tie your analog input to ground through a high value resistor so that when the switch is open the analog input will go to 0 volts. Floating inputs can read anything if they are not tied to +5 or ground, either through the internal pullups, or through external pull up/down resistors.
|
|
|
|
|