Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 44
61  Using Arduino / General Electronics / Re: Washable crystal on: July 08, 2013, 01:50:12 pm
Thanks for all the feedback. I like the denatured ethanol idea and might give it a try. With a good drying from an old hair dryer.
62  Using Arduino / General Electronics / Re: Washable crystal on: July 07, 2013, 11:04:41 pm
I use hot water and soap. I used to use household alcohol, but it seemed to 'dull' the board --take away the nice shine. I use a flux that is 'water soluable'. I could see parts like the atmega328P-AU, 0803 CAps & Resistors, being unaffected by dipping in hot water but it seemed to me the crystal package would seep liquid into it?  Maybe not??
De-ionized water- will that clean the flux off good?  No soap?  Is that the same as distilled water or is it hard to come by?
63  Using Arduino / General Electronics / Washable crystal on: July 07, 2013, 07:50:16 pm
Is there such a thing as a washable crystal?  I like to give my board a good hot soapy bath after soldering all the washable components on, and would like to use more components that are washable. I've always assumed SMD crystals are not washable. I use this one:
http://www.digikey.com/product-detail/en/ECS-160-20-3X-TR/XC1776CT-ND/2676640
The data sheet says nothing about washable. Anyone know much about crystals and/or of a washable type?
64  Using Arduino / General Electronics / Re: adding LED's to Rx/Tx lines of 328 TFQP SMD to show uploading action on: July 06, 2013, 09:47:37 am
But then when I unplug the FTDI cable, the pins will be low, and the LED's will be on all the time won't they?
65  Using Arduino / Programming Questions / Re: Millis() rover over handling on: July 06, 2013, 09:28:07 am
Oh, I see what you're saying. 
If DoorError() is called, it shuts the whole system down ending with an endless while{} statement, waiting for the user to fix the problem.
66  Using Arduino / Programming Questions / Re: Millis() rover over handling on: July 06, 2013, 09:11:50 am
Code:
There is no problem with rollover, however I can see DoorError being called every 10 mS.
why?  I don't see it.
67  Using Arduino / General Electronics / Re: adding LED's to Rx/Tx lines of 328 TFQP SMD to show uploading action on: July 06, 2013, 09:08:13 am
I think the LEDs referred to are connected to the uC Rx & x lines as added indicaters, not pins 22 & 23 of the FTDI chip.
Correct.
I tested this FTDI cable I use from Sparkfun, and both the Rx/Tx lines are high when I have it plugged in my USB port.
So I may need to just skip the indicator LEDs.  They were just to give a visual on loading sketches.
68  Using Arduino / General Electronics / Re: adding LED's to Rx/Tx lines of 328 TFQP SMD to show uploading action on: July 05, 2013, 11:30:48 pm
I went with the 5K resistors.  Got my first board back for the fab shop with this setup, but they don't work right.  When I plug my FTDI cable into my board, the LEDs are lit up all the time.  I can see them flashing when I load a sketch.  Are the Rx/Tx lines of the FTDI cable normally high?
Here's the schematic of the LED's I added to the Rx/Tx lines.
69  Using Arduino / Programming Questions / Re: Millis() rover over handling on: July 05, 2013, 03:10:18 pm
As long as the interval being timed (30 sec here) is less than the ~50 day millis() rollover interval, and if the comparison is done with subtraction and unsigned variables as it is here (good job!) then the rollover will never be a problem. The code will operate the same even if rollover occurs during the 30 second interval.

Thanks!
70  Using Arduino / Programming Questions / Millis() rover over handling on: July 05, 2013, 02:07:56 pm
In this code, will millis() roll over be a problem?  This routine is called to run a motor twice a day all year.  The mills() is only used to check for a stuck door.  If I've got the logic of it figured out, I think if the rollover does occur during this routine, it just won't have the error protection.  That's fine, I just don't want it to be forced into an error if the rollover happens during the routine.
Code:
void OpenDoor(){
  digitalWrite(HBRIDGEpower, HIGH);  //power up the H Bridge
  delay(1000);  //give it a chance to stabilize
  digitalWrite(motorOpenPin, HIGH);    //Turn on the motor pin that give the open direction
  unsigned long startMillis = millis(); //create a counter
  while(1){
    if (millis() - startMillis > 30000) DoorError(); //longer than 30 sec means the string is tangled
    if (digitalRead(TopSwitch) == 0) { //Switch is closed
      digitalWrite(motorClosePin, LOW);  //Brake
      digitalWrite(motorOpenPin, LOW);  //Brake
      delay(500); //wait a bit
      digitalWrite(HBRIDGEpower, LOW);  //power down the H Bridge
      break;
    }
    delay(10);
  }
}
71  Using Arduino / Networking, Protocols, and Devices / Re: Understand bits/bytes, and reading the datasheet for the DS3234 on: July 03, 2013, 07:53:38 am
I found a library that looks hopeful!
72  Using Arduino / Networking, Protocols, and Devices / Re: Understand bits/bytes, and reading the datasheet for the DS3234 on: July 02, 2013, 10:45:03 pm
Setting the alarm seems WAY harder than reading the time.
I understand most of this example sketch from Sparkfun's site:
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/BreakoutBoards/DS3234_Example_Code.pde

I will need the alarm to sound when the hours, minutes, and seconds match, so I will need to set Bit 7 (A1M4) to 1 on 8Ah. 
I gather this from Table 2, Page 13:
https://www.sparkfun.com/datasheets/BreakoutBoards/DS3234.pdf


If I have my alarm time that I need to set in this variable:
Code:
int AlarmTime [3]; //second,minute,hour
Can someone show me how to set the alarm registers.
It must be similar to this (setting the time)
Code:
//=====================================
int SetTimeDate(int d, int mo, int y, int h, int mi, int s){
int TimeDate [7]={s,mi,h,0,d,mo,y};
for(int i=0; i<=6;i++){
if(i==3)
i++;
int b= TimeDate[i]/10;
int a= TimeDate[i]-b*10;
if(i==2){
if (b==2)
b=B00000010;
else if (b==1)
b=B00000001;
}
TimeDate[i]= a+(b<<4);
 
digitalWrite(cs, LOW);
SPI.transfer(i+0x80);
SPI.transfer(TimeDate[i]);       
digitalWrite(cs, HIGH);
  }
}
73  Using Arduino / Networking, Protocols, and Devices / Re: Understand bits/bytes, and reading the datasheet for the DS3234 on: July 02, 2013, 10:11:30 pm
Ok, now I see why you said that.  ...be sure the alarm's not set for a bad time before turning it on.
Now to figure out how to set the alarm.  I'll take a stab at it and then ask for help/corrections.  Come back in 20 minutes!
74  Using Arduino / Networking, Protocols, and Devices / Re: Understand bits/bytes, and reading the datasheet for the DS3234 on: July 02, 2013, 09:59:42 pm
I might set the alarm registers (0x87-0x8A) first, before enabling the alarm, but it looks like you have the basics sussed out. If the EOSC bit is set to 1, when Vcc power is not applied, the RTC won't keep time at all.

Ok, but I'll be changing the alarm time 2x a day. Should I resend this after each time I change the alarm?
Code:
SPI.transfer(0x8E);
SPI.transfer(0x05); //Alarm1 Enabled
Or is just the first initial time good enough?
75  Using Arduino / Networking, Protocols, and Devices / Understand bits/bytes, and reading the datasheet for the DS3234 on: July 02, 2013, 09:18:07 pm
Trying to learn a little about the DS3234.  This writing data to the registery is all new to me, but I've figured out about setting different bits high or low, I think.
https://www.sparkfun.com/datasheets/BreakoutBoards/DS3234.pdf

On page 14:
I would want the oscillator to be running (Bit 7), to give good time keeping, correct?  So it would be 0.
I will be using alarm 1, not the square wave output, so bit 3,4,5,6 are of no importance, so they are 0.
Bit 0 is set to 1 to enable  alarm 1.
Bit 0 = 1
Bit 2 = 4
_______
= 5 = 0x05

So I would initiate it like this:
Code:
int RTC_init(){
 pinMode(cs,OUTPUT); // chip select
 SPI.begin();  // start the SPI library:
 SPI.setBitOrder(MSBFIRST);
 SPI.setDataMode(SPI_MODE1); // I won't be using SPI for anything else
 //set control register
 digitalWrite(cs, LOW);  
 SPI.transfer(0x8E);
 SPI.transfer(0x05); //Alarm1 Enabled
 digitalWrite(cs, HIGH);
 delay(10);
}

Pages: 1 ... 3 4 [5] 6 7 ... 44