Show Posts
Pages: 1 2 [3] 4 5 ... 44
31  Using Arduino / General Electronics / Re: Adding a FTDI to my project on: February 27, 2014, 07:35:39 am
Thanks. I should have checked that. 
I'm pretty sure I have the Rx & Tx connected wrong too.
32  Using Arduino / General Electronics / Re: Adding a FTDI to my project on: February 27, 2014, 06:55:53 am
Huh?
I don't know what VUSB is. Here's photos of the schematic I'm talking about in case you can't view the PDF files.
The before and after. Please read my first post to see my question.
33  Using Arduino / General Electronics / Re: Adding a FTDI to my project on: February 26, 2014, 10:56:12 pm
To visualize my question, here is the schematic after I made these changes.  Will this work? 
I'm wondering if the TX & RX pins are connected correctly, though.  Do I need the FTDI's TX pin to connect to the Atmega328's RX pin?
34  Using Arduino / General Electronics / Adding a FTDI to my project on: February 26, 2014, 10:48:24 pm
I want to add an FTDI chip to my project so it can be connected via USB, rather than a separate FDTI cable.
So I copied the schematic from the FTDI basic, from Sparkfun, and pasted it into my new project.  
Since I won't be using 3.3 volts, can I delete C1 and the net connected to pin 17 on the FTDI chip? And can I remove the solder jumper SJ2, and then connect pin 4 on the FTDI chip to 5V?  I think this is right, but want to make sure.
After doing this, the 2 schematics will just kinda merge together into one I believe, with the FTDI allowing the USB port to talk to the Atmega chip.
Thanks.


ps.  Also, I see CTS from the FTDI chip will not be connected to anything.  It's ok to leave it unconnected?  The DTR pin is what resets the Atmega chip during programming, right?
35  Using Arduino / Project Guidance / Re: disabling a MAX16910 with a DS3234 on: February 26, 2014, 11:57:29 am
I think the BSS138W is what I need, but I'm not sure of the schematic.  Here's a photo of an attempt.
The MAX16910 when powered up, will supply 5V to the DS3234, an Atmega chip, and other components like a LCD, etc.  When it's not powered up, the DS3234 will run on low quiescent current from it's coin cell battery, awaiting the next alarm trigger to power things back up.

MAX16910 datasheet
http://datasheets.maximintegrated.com/en/ds/MAX16910.pdf

BSS138W datasheet
http://www.fairchildsemi.com/ds/BS/BSS138W.pdf

DS3234 datasheet
https://www.sparkfun.com/datasheets/BreakoutBoards/DS3234.pdf
36  Using Arduino / Project Guidance / disabling a MAX16910 with a DS3234 on: February 26, 2014, 09:58:34 am
http://www.maximintegrated.com/datasheet/index.mvp/id/6336
this regulator uses only 1.6 uA when it's disabled. To enable to regulator, the EnablePin must to driven high. 
https://www.sparkfun.com/datasheets/BreakoutBoards/DS3234.pdf
The DS3234 can sleep, using only 1.5uA from it's coin cell battery.  So I want to shut down my project (Atmega328 is the base of it), by controlling the MAX16910 regulator with the INT pin from the DS3234.  But the DS3234 uses it's alarm to trigger the INT Pin to go LOW, but the MAX16910's enable pin is active high, so to startup the regulator, i have to pull its enable pin HIGH.  Is it possible to have the DS3234's INT pin do this with minimal extra components and quiescent current?
37  Using Arduino / Microcontrollers / Getting back to my question on: February 17, 2014, 06:10:22 am
http://3g1l.com/blog-burn-bootloader-blank-atmega328atmega328p-arduino-uno
On the page we find this:
Quote
Update:
If your chip comes straight out of the factory it 'should' be fused to work without an external clock -  meaning that you don't need the clock and the two capacitors.
But if you allready burnt a bootloader (even if it was aborted) or your supplier modifed the fuses for some reason - you need them.

To remove some of the variables from my question;
1) the only purpose of my project is to burn boot loaders to different chips, so,
     A) it's only a temporary setup for the second chip
     B) the primary chip won't be doing anything else, so it won't matter if even all it's CPU is consumed in this task.
     C). The secondary chip I'm burning, when installed in its permanent home, will have a 10k resistor on the reset pin, and crystal and caps for 16 MHz.

So then I was hoping I could burn a boatloader to them without the caps, & crystal, and maybe even the resistor. But this quote from another website says if the chip is already is fused for a crystal it won't work. I just wondered if this was true?  If it not true, I've got a meat idea that I think others would enjoy, but it means burning a boot loader on an atmega328P-AU without the crystal. And it can't be that it must he fused right to start with. It has to work either way. 
Hope this clears up my question a little.
38  Using Arduino / Microcontrollers / Burning boot loader without reset resistor on: February 16, 2014, 12:49:24 pm
http://arduino.cc/en/Tutorial/ArduinoToBreadboard#.UwD6jX-9KSM
In this example, could the 10K resistor be omitted if the Arduino ISP sketch was modified to set the reset pin high on the chip to be burned, rather than the resistor pulling it high. Would the Arduino not act as the 10K pull-up resistor?  There'd be the issue of current limiting  which the 10K resistor does, but wouldn't the Arduino doing the boot loading limit it's output, and with the whole process just taking long enough to burn a boot loader...  Maybe the 10K is definitely needed?  Anyone know for sure?  Thanks.
39  Using Arduino / Microcontrollers / Re: Arduino as ISP Programmer, but using different pins on: February 16, 2014, 09:44:37 am
When burning a boot loader onto an Atmega328P on a breadboard with an UNO as the ISP, do you necessarily have to use the pins 10 thru 13 on the Arduino UNO. 
You can use any pins you want but you will have to implement a bit-banged SPI.  TinyISP actually has the majority of what you want.  It's coded to use the symbols MISO, MOSI, SCK, and RESET to identify the SPI pins.  Those would have to be changed to whatever pins you want to use.  The relevant code starts here.

Thanks!  I'll check this out and may be back for more help!  I'll set up some code to use alternate pins and see how it works.
40  Using Arduino / Microcontrollers / Re: Is the Micro kinda weird? on: February 15, 2014, 10:46:48 pm
Posting your code for us look at, might speed up the help we can give.
41  Using Arduino / Microcontrollers / Arduino as ISP Programmer, but using different pins on: February 15, 2014, 10:44:43 pm
http://arduino.cc/en/Tutorial/ArduinoISP#.UwA0f3-9KSN
When burning a boot loader onto an Atmega328P on a breadboard with an UNO as the ISP, do you necessarily have to use the pins 10 thru 13 on the Arduino UNO.  Could you use any pins, and just change the pins number in the ISP sketch loaded on the UNO, or does it HAVE to be the pins affiliated with MISO, MOSI, and SCK, on the UNO?
42  Using Arduino / Sensors / Re: Is noInterrupts(); needed with a volatile variable? on: February 06, 2014, 08:32:41 am
Wow!
43  Using Arduino / Sensors / Re: Is noInterrupts(); needed with a volatile variable? on: February 06, 2014, 08:10:40 am
Thanks! That makes sense. Just curious, I wonder how long it takes to read the flowsensecount value?  I guess the flowmeter puts out about 10 pulses per second, so that 100 ms. It probably only takes a ms or 2 to check if flowsensecount is larger than the limit.
44  Using Arduino / Sensors / Is noInterrupts(); needed with a volatile variable? on: February 05, 2014, 11:53:53 pm
In the code below, in void Brew(), do I need the noInterrupts(); and interrupts(); lines?  The variable FlowSensorCount is declared volatile, and an interrupt runs the code "FlowSensorCount++;"
Perhaps I need to turn off interrupts when checking that variable, or maybe not?  Won't that make my flow meter miss some counts when interrupts are turned off.

Code:
// D2---FLOW SENSOR
// D3--WATER VALVE SOLENOID
#include <LED.h>
#include <Button.h>
Button startButton = Button(A5,PULLUP);
Button fullButton = Button(A2,PULLUP);
Button halfButton = Button(A0,PULLUP);
LED startLED = LED(A4);
LED fullLED = LED(A3);
LED halfLED = LED(A1);
//3 selection conditions:
const int emptyPot = 0;   //no selection made
const int fullPot = 1;    //full pot selection
const int halfPot = 2;    //half pot selection
// variables:
int potSelection = 0;     //selection starts out with nothing on power up
int fullCount = 200;     //number of pulses for a full pot of coffee
int halfCount = 100;     //number of pulses for a half pot of coffee
unsigned long lastPress;  //last time any button was pressed, for timeout
//***************setup variables***************
volatile int FlowSensorCount;  //the counter for the flow sensor
void setup() {
  Serial.begin(9600); //initiate serial port
  Serial.println("Bunn Coffee Water Version 1.0");

  attachInterrupt(0, CountPulse, RISING);//turn on interrupt for flow sensor on pin 2
  digitalWrite(2, HIGH);    //turn on pull up resistor for flow sensor on pin 2
  delay(200);
}

void CountPulse() //called from the interupt on Pin 2, from the water sensor
{
  FlowSensorCount++;  //increases count by 1
}

void loop() {
  updateStartLED(); //update start LED status
  if (fullButton.isPressed()){ //if the full button was pressed
    lastPress = millis(); //update the time
    Serial.println("Full Selection Button was pressed");
    fullLED.on();  //turn on full LED
    halfLED.off();   //turn off half LED
    potSelection = fullPot; //they selected a full pot
  }
  if (halfButton.isPressed()) { //if the half button was pressed
    lastPress = millis(); //update the time
    Serial.println("Half Selection Button was pressed");
    halfLED.on(); //turn on half LED
    fullLED.off();//turn off full LED
    potSelection = halfPot; //they selected a full pot
  }
  if (startButton.isPressed()) { //if the startbutton was pressed
    lastPress = millis(); //update the time
    Serial.println("Start Button was pressed");
    if (potSelection == fullPot) Brew(fullCount); //brew a full pot
    else if (potSelection == halfPot) Brew(halfCount); //brew a half pot
    else flashSelection();
  }
  if (millis() - lastPress > 10000) { //they changed their mind?
    potSelection = emptyPot; //cancel the selection
    fullLED.off(); //turn off any LEDS
    halfLED.off(); //turn off any LEDS
    startLED.off(); //turn off any LEDS
  }
  delay(100);
}

void Brew(int pulseCount){
  int solenoidPin = 3; //water valve solenoid pin
  pinMode(solenoidPin, OUTPUT); //set it as an output   
  FlowSensorCount = 0; //reset sensor count
  digitalWrite(solenoidPin, HIGH);  //turn on the water valve
  while (1) {
    noInterrupts();
    if (FlowSensorCount >= pulseCount) {
      digitalWrite(solenoidPin, LOW);  //turn off the water valve
    interrupts();
    break;
    }
  }
}

void updateStartLED() {
  if (potSelection == emptyPot) return; //no selection is made so do nothing with the start LED
  unsigned long lastBlink; //last state change
  if (millis() - lastBlink > 500) { //it's time to toggle
    startLED.toggle();
  } 
}

void flashSelection() {
  //user pressed start before making a selection
  //flash the half and full LEDS to give them a hint on what to do!
  Serial.println("make a selection first! (Half or Full)");
  boolean state;
  halfLED.on();
  for (int i = 0; i < 10; i++) {
    state = !state; //change the LED state
    halfLED.toggle();
    fullLED.toggle();
    delay(100);
  }
  halfLED.off();  //turn off on leaving
  fullLED.off();  //turn off on leaving
}
45  Using Arduino / General Electronics / Re: Protecting 120 VAC on my board on: February 05, 2014, 12:23:38 am
I have lots of different paints, enamels, silicone caulk, plumber goop…  Would any of these work to project the bottom of the board?
Pages: 1 2 [3] 4 5 ... 44