Show Posts
Pages: 1 2 [3] 4 5 ... 93
31  Using Arduino / Project Guidance / Re: schematic and board check please on: March 02, 2014, 06:34:58 pm
Ignoring it!
It's what I usually do
32  Community / Gigs and Collaborations / Re: Help with a Sharp IR distance sensor and water tank - Will pay on: March 02, 2014, 06:14:51 pm
Mike. I sent you an email friday. smiley I guess you never got it. Pm me.
'tis done!
33  Community / Gigs and Collaborations / Re: Help with a Sharp IR distance sensor and water tank - Will pay on: March 02, 2014, 06:06:08 pm
We'll I am interested!
34  Using Arduino / Project Guidance / [solved!]: schematic and board check please on: March 02, 2014, 05:35:51 pm
ok I'm stumped
it's a simple enough board
FTDI chip and ATmega328p

the FTDI seems to work. I tried shorting TX and RX, open the monitor, whatever I type in gets echoed

the ATmega bit is more of a problem
I've installed optiBoot, LED 13 flashes 3 times so I guess that's ok

but I can't upload sketches

again, if I short D0 and D1, whatever I type in the monitor gets echoed
so it looks like everything up to D0, D1 is ok

I'm using a 16 MHz resonator instead of 8MHz

I have another board with identical MCU design, just laid out differently, it works

I tried bypassing the FTDI part (in fact didn't install the chip)
used a SparkFun FTDI Basic
it talks to the "previous" design, but not this one

I'm tearing what's left of my hair out

would be most obliged for someone to point out my stupid mistake:

thanks!

schematic:


board:


edit to change title to solved smiley
35  Community / Gigs and Collaborations / Re: Help with a Sharp IR distance sensor and water tank - Will pay on: February 28, 2014, 05:43:14 am
I'm interested
can you send me links to the parts you're using and I'll take a look
cheers
Mike
36  Community / Workshops and Events / Re: Free Hacktivism Workshop, Wed, Feb 19 Eindhoven on: February 25, 2014, 05:55:16 pm
Are you seriously running a spammers bootcamp?
Outrageous!
37  Community / Gigs and Collaborations / Re: seeking Arduino consultant for solar appliance on: February 25, 2014, 05:49:52 pm
I'm interested, sent you an email
Cheers
Mike
38  Community / Exhibition / Gallery / Re: Turn your face tanner into a pcb UV lamp on: February 24, 2014, 09:53:36 am
like it! smiley
39  Using Arduino / General Electronics / Re: Finished building a signal generator, but one annoying problem exists. on: February 22, 2014, 03:07:02 am
Looks to me that your scope probe needs tuning
Connect it to a known square wave and adjust the input capacitance (small screw I'm probe) until the picture is a proper square wave
You are getting overshoot due to the probe
40  Using Arduino / General Electronics / Re: LEONARDO - DS1307 RTC module need help (NEWBIE) on: February 15, 2014, 05:33:17 pm
I would add delay(1000); to loop to give it a chance!
Also, just click the icon, top right of the IDE  to open monitor
41  Community / Exhibition / Gallery / Re: Just to share... (5 x 10watt RGBs) no current regulation! on: February 15, 2014, 03:25:26 pm
my eyes hurt now smiley
42  Using Arduino / General Electronics / Re: LEONARDO - DS1307 RTC module need help (NEWBIE) on: February 15, 2014, 02:26:07 pm
on a UNO definitely use A4=SDA, A5=SCL
Leonardo SDA and SCL are near Aref and Ground
(sorry previous info was for Mega - smiley-sad )

try adding
Code:
Serial.println("RTC test");
to setup, just to make sure the serial port is actually open
43  Using Arduino / Programming Questions / Re: Calculating temperature from thermistor on: February 15, 2014, 12:39:41 pm
I would start by splitting that calculation into smaller steps
and write the intermediate results to Serial
by the time you've done that you will PROB90 see the problem!
44  Using Arduino / Programming Questions / sleep and PCINT again (yes I know!) on: February 15, 2014, 12:09:46 pm
I'm struggling to get a grip on using WDT to wake up from sleep in the same sketch as a PCINT interrupt
my aim is for the WDT to wake every second, with the PCINT just counting interrupts in the background

my sketch wakes successfully every second on the WDT, as long as there are no interrupts
if there are interrupts, it seems to not wake up
what I suspect is happening is I am managing to reset the clock every interrupt
so it doesn't get the chance to timeout

code is here:
main sketch
Code:
const byte LED = 6;

extern boolean wdtFlag;
extern boolean windFlag;

//======
// setup
//======
void setup(void)
{
  Serial.begin(57600);
  Serial.println("sleep.wake.tester");
  pinMode(LED, OUTPUT);
  flash();
  windInit();
  sleep(true);
}

//======
// loop
//======
void loop(void)
{
  if (wdtFlag)
  {
    Serial.print('D');
    Serial.flush();
    flash();
    wdtFlag = false;
    sleep(true);
  }
 
  if (windFlag)
  {
    Serial.print('W');
    Serial.flush();
    windFlag = false;
    sleep(false);
  }
}

void flash(void)
{
  //==========
  // flash LED
  //==========
  for (byte i = 0; i < 1; i++)
  {
    digitalWrite (LED, HIGH);
    delay (50);
    digitalWrite (LED, LOW);
    delay (50);
  }   
}

sleep stuff is here:
Code:
#include <avr/sleep.h>
#include <avr/wdt.h>

boolean wdtFlag;

//=====================================================================================
// prepare the watch dog timer and sleep
//=====================================================================================
void sleep(boolean start)
{
  // on entry
  // true = start the clock
  // false = leave clock running
  //============================
 
  Serial.println('s');
  Serial.flush();

  // set interrupt mode and interval
  //
  // WDP3 WDP2 WDP1 WDP0 timer   ~seconds
  //    0    0    0    0   16 mS
  //    0    0    0    1   32 mS
  //    0    0    1    0   64 mS
  //    0    0    1    1  128 mS 0.125
  //    0    1    0    0  256 mS 0.25
  //    0    1    0    1  512 mS 0.5
  //    0    1    1    0 1024 mS 1
  //    0    1    1    1 2048 mS 2
  //    1    0    0    0 4096 mS 4
  //    1    0    0    1 8192 mS 8
  //
  //============================================
 
  MCUSR = 0;     

  if (start)
  {
    // starting the timer
    //===================
   
    // clear various "reset" flags
    //============================
     
  }
     
  if (start)
  {
    // allow changes, disable reset
    //=============================
    WDTCSR = bit (WDCE) | bit (WDE);

    // wdt enabled and 1 second timer
    //===============================
    WDTCSR = bit (WDIE) | bit (WDP2) | bit (WDP1);
  }
 
    // call reset
    //===========
    wdt_reset();
 

  // set sleep mode
  //===============
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);

  // disable ADC
  //============
  ADCSRA = 0; 
 
  // turn off brown-out enable in software
  //======================================
  MCUCR = bit (BODS) | bit (BODSE);
  MCUCR = bit (BODS);

  // sleep...
  //=========
  sleep_mode();





  // ... and wake-up
  //================
 
 
  // disable the timer
  //==================
  sleep_disable();

  // enable ADC
  //===========
  ADCSRA |= _BV(ADEN);

  Serial.print('w');
  Serial.flush();
}

//=====================================================================================
// watchDogTimer interrupt
//=====================================================================================
ISR(WDT_vect)
{
  // just set the watchdog flag
  //===========================
  wdtFlag = true;
}

and finally the interrupt:
Code:
//=================================
// wind
//=================================
#define WINDSPEEDPIN 3

//=================================
// flag to show interrupt was from wind
//=================================
boolean windFlag;

//=====================================================================================
// interrupt handler for wind ticks
//=====================================================================================
void handleWindTick()
{
  // simply increment the counter
  //=============================
  windFlag = true;
}

//=====================================================================================
// routine to initialise wind sensors
//=====================================================================================
void windInit(void)
{
  pinMode(WINDSPEEDPIN, INPUT_PULLUP);

  // INT1 => D3
  //======================
  attachInterrupt(1, handleWindTick, LOW);         
 
  // ensure interrupts are enabled
  //==============================
  interrupts();

  windFlag = false;

  Serial.print('w');
}

with no interrupts I get
Code:
wDs
with the LED flashing every second smiley

with interrupts I get
Code:
wWs
with no LED, until I stop the interrupts, when it reverts to flashing correctly

I would be delighted if someone could cast an eye and tell me where I have been a plonker!
thanks
45  Community / Gigs and Collaborations / Re: HELP HELP HELP HELP FOR MY PROJECT PLEASE!IF YOU HELP ME YOU ARE VERY SMART!!!!! on: February 11, 2014, 03:02:22 pm
it might help if you looked at the sticky "how to use this forum"
Pages: 1 2 [3] 4 5 ... 93