Show Posts
Pages: 1 ... 45 46 [47] 48
691  Using Arduino / Sensors / Re: Does a DHT22 get bored? on: December 02, 2011, 11:51:47 am
I haven't had the same issue. However, I use 1K resistors per one of the spec sheets.

I assume that you're not trying to get more than one reading every couple of seconds, right? That's one thing that the DHT22 is very slow on, leading to bus errors. Also, I would double-check the power going into the device, i.e. make sure you have 3-5V on pin 1 (IRRC).

692  Using Arduino / Sensors / Re: Sensor to sense 2000w current??? on: November 29, 2011, 09:54:42 pm
I suggest a current switch from the likes of Cr magnetics. Much lower cost, easy to interface with arduino and non-contact.
693  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: November 29, 2011, 09:46:48 pm
I agree that the Bobuino is a great tool.

Like the brewtroller, it is a remarkable unit based on the 1284p chip. They have different functions and unfortunately, neither was quite right for my application. However, I wouldn't question the prices charged considering the components on these boards and the production quantities. Just do a digikey BOM of a Bobduino or Brewtroller, the folk that put these devices together are not getting rich offering them.

The device I am working on will be more expensive than either of the above. Just the SMD assy will be on the order of $50 a board in 100 unit quantities. If all you want to do is program a 1284p then a $10 chip and some bits and bobs and a breadboard will put you in business. But the main reason that folk get Mega's, 644's and 1284p's is lots of sensors, I/o devices, etc. and their attendant libraries.  That's why the bahbot, Bobduino, and Brewtroller have so much to offer on their boards.
694  Using Arduino / Sensors / Re: Question regarding High Pass Filter on: November 28, 2011, 07:31:27 pm
Thank you so much, that answered all of my questions. I did get my simpler approach to work with loads but under a no-load condition (i.e. just a current sensor on the AC line) there was all sorts of very interesting noise in the signal that blew up the results. In other words, use the approach promoted by Atmel and Openenergymonitor! Thanks again.
695  Using Arduino / Sensors / Question regarding High Pass Filter on: November 26, 2011, 04:56:12 am
I have a question regarding filtering to remove a DC offset bias. Specifically, I wonder whether the approach of the open energy monitor project is overly complex assuming the front end hardware (i.e. the analog inputs) has been designed with easy DC offset bias removal in mind. You can read about the theory / details behind their approach over at http://openenergymonitor.org/emon/node/59 but the basic approach is to take a varying AC signal (from a AC-AC transformer, for example) and then to use a voltage divider + capacitor as a DC offset source to make the signal all-positive for the arduino to read.

My approach to the hardware side was slightly different. A small linear voltage regulator creates a reference voltage for the arduino (i.e. AREF = 1.25V). Two 1k resistors (with a 1% tolerance) are used for the offset bias voltage divider. That way, the DC bias offset should always be equal to 1/2 the reference voltage. Measurements of the voltage and current inputs without external inputs attached confirm that the numeric ADC values are 511-512, just as one would expect.

The OpenEnergyMonitor group came up with a nifty way on the software side to remove bias, regardless of how the DC-bias voltage divider was set up. I suppose this is a great / better approach if the DC offset is not known, or drifts, etc. The snippet of their code below shows their approach to removing offsets as part of their measurement loops.
Code:
lastSampleV=sampleV;                          //Used for digital high pass filter
    lastSampleI=sampleI;                          //Used for digital high pass filter
    
    lastFilteredV = filteredV;                    //Used for offset removal
    lastFilteredI = filteredI;                    //Used for offset removal  
    
    //-----------------------------------------------------------------------------
    // A) Read in raw voltage and current samples
    //-----------------------------------------------------------------------------
    sampleV = analogRead(inPinV);                 //Read in raw voltage signal
    sampleI = analogRead(inPinI);                 //Read in raw current signal

    //-----------------------------------------------------------------------------
    // B) Apply digital high pass filters to remove 2.5V DC offset (centered on 0V).
    //-----------------------------------------------------------------------------
    filteredV = 0.996*(lastFilteredV+sampleV-lastSampleV);
    filteredI = 0.996*(lastFilteredI+sampleI-lastSampleI);

In the interest of speed (and simpler code), I would like to just use simple subtraction for the filtering. i.e.
Code:
filteredV = analogRead(inPinV)-512;                 //Read in raw voltage signal and subtract DC offset
filteredI = analogRead(inPinI)-512;                 //Read in raw current signal and subtract DC offset
Is there something I should be considering when doing this (that lead the openenergymon group down their particular path)? Also, any idea where/why they are applying the 0.996 multiplier?

Any suggestions are welcome and thanks to Grumpy Mike for posting his thoughts on how to protect the inputs of an Arduino using a BAV99, a cap, and a resistor.
696  Using Arduino / Microcontrollers / Re: Using the 1284p/664p (IDE, bread board and boot loaders) on: November 23, 2011, 08:46:30 pm

i have same problem, but i use USBTinyISP v2 and it "Works with any AVR ISP chip with 64K of flash (or less) - does not work with Atmega1281/1280/2561/2560" i can upload small sketches like "blink" with it, but when i try to Burn Bootloader to Sanguino1284 there is some error after few minutes..  "debug" led start flashing on some bootloaders..
I ran into that problem about two weeks ago and contacted adafruit industries to update their store and usbtiny support pages. Fwiw, ladyada knew of the problem already but I guess she hadn't seen the need yet to update her website pages.

As far as uploading stuff goes, my guess is that success depends on how big your program is and where in the memory space it is being stored. Boot loaders are impossible to be burned at the present time with the usbtiny, ladyada stated that hardware and software issues are the reason. In other words, do not expect a firmware update to make your usbtiny 1284p-compatible.

I had good luck uploading the brewtroller boot loader, etc. onto my tqfp-form factor 1284p using the avr ISP mk2.
697  Using Arduino / Microcontrollers / Re: Need Help with TQFP-44 version of 1284P bootloader on: November 17, 2011, 07:25:32 pm
OK, for the benefit of anyone else following in my footsteps, I found success via the Brewtroller version of the Arduino IDE. Not only do the guys there do a great job of integrating it all, it even works!

I was able to get bootloaders onto both chips without error messages. Serial communications eludes me for the time being, I will retry that later. In the meantime, I am using the AVR ISP mkII to program both chips (with success!) For example, the blink program works.

The only remaining trouble I ran into was pin labeling. I thought I had a good idea of how the digital pins were distributed until I tried to run the blink program on the 1284P... and got nothing. Further digging over at the sanguino web site led me to a schematic showing the pins and also explained why I had to blink on pin 7 to make my SCK activity light go on/off.

My hat off to the folk over at Brewtroller regarding their project. If I ever get into beer brewing, that is a nifty controller to do all the heavy lifting. Thanks again everyone for your help!

Lastly, I hope that the folk at the Arduino project can get around to including more of the AVR chips out there via Mark Sprouls amazing library and the work over at Brewtroller, etc. This set doesn't have to be part of the default library, make it an add-on if you want to minimize the feature-set for the masses (and hence reduce potential confusion) while also offering those that want to use non-standard AVRs an easy way to get going.
698  Using Arduino / Microcontrollers / Re: Need Help with TQFP-44 version of 1284P bootloader on: November 17, 2011, 08:54:36 am
Thank you, I appreciate it!

The AVR ISP mkII allegedly also supports the 1284P natively. However, the programmer you reference is not only less expensive, it's smaller too! So much to learn...

Crossroads, you posted the following 1284P config file... would it work on the TQFP version of the chip or are they not pin compatible? The reason I ask is that the TQFP version of the chip has 44 pins, while the DIP version only has 40. As best as I can tell, it's not that the TQFP version has more inputs, just more VCC and GND pins. However, the added pins will impact the pin assignment, I imagine.

So if skyjumper doesn't respond, would a combination of the Brewtroller 644 arduino.conf and the below do the trick? That is, use the pin assignments from the 644 file but the other inputs from what you posted?

Code:
#------------------------------------------------------------
# ATmega1284P
#------------------------------------------------------------

# similar to ATmega164p

part
    id               = "m1284p";
    desc             = "ATMEGA1284P";
    has_jtag         = yes;
    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode   = 0x74;
    signature        = 0x1e 0x97 0x05;
    pagel            = 0xd7;
    bs2              = 0xa0;
    chip_erase_delay = 9000;
    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                       "x x x x  x x x x    x x x x  x x x x";

    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                       "x x x x  x x x x    x x x x  x x x x";

    timeout = 200;
    stabdelay = 100;
    cmdexedelay = 25;
    synchloops = 32;
    bytedelay = 0;
    pollindex = 3;
    pollvalue = 0x53;
    predelay = 1;
    postdelay = 1;
    pollmethod = 1;

    pp_controlstack     =
        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay    = 100;
    progmodedelay       = 0;
    latchcycles         = 6;
    togglevtg           = 1;
    poweroffdelay       = 15;
    resetdelayms        = 1;
    resetdelayus        = 0;
    hvleavestabdelay    = 15;
    chiperasepulsewidth = 0;
    chiperasepolltimeout = 10;
    programfusepulsewidth = 0;
    programfusepolltimeout = 5;
    programlockpulsewidth = 0;
    programlockpolltimeout = 5;

    idr                 = 0x31;
    spmcr               = 0x57;
    allowfullpagebitstream = no;

    memory "eeprom"
        paged           = no; /* leave this "no" */
        page_size       = 8;  /* for parallel programming */
        size            = 4096;
        min_write_delay = 9000;
        max_write_delay = 9000;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
read            = "  1   0   1   0      0   0   0   0",
                          "  0   0   x   x    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

write           = "  1   1   0   0      0   0   0   0",
                          "  0   0   x   x    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

loadpage_lo = "  1   1   0   0      0   0   0   1",
 "  0   0   0   0      0   0   0   0",
 "  0   0   0   0      0  a2  a1  a0",
 "  i   i   i   i      i   i   i   i";

writepage = "  1   1   0   0      0   0   1   0",
 "  0   0   x   x    a11 a10  a9  a8",
 " a7  a6  a5  a4     a3   0   0   0",
 "  x   x   x   x      x   x   x   x";

mode = 0x41;
delay = 10;
blocksize = 128;
readsize = 256;
      ;

    memory "flash"
        paged           = yes;
        size            = 131072;
        page_size       = 256;
        num_pages       = 512;
        min_write_delay = 4500;
        max_write_delay = 4500;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
        read_lo         = "  0   0   1   0      0   0   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

        read_hi         = "  0   0   1   0      1   0   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

        loadpage_lo     = "  0   1   0   0      0   0   0   0",
                          "  0   0   x   x      x   x   x   x",
                          "  x  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

        loadpage_hi     = "  0   1   0   0      1   0   0   0",
                          "  0   0   x   x      x   x   x   x",
                          "  x  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

        writepage       = "  0   1   0   0      1   1   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7   x   x   x      x   x   x   x",
                          "  x   x   x   x      x   x   x   x";

mode = 0x41;
delay = 10;
blocksize = 256;
readsize = 256;
      ;

    memory "lock"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
                          "x x x x  x x x x   x x o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
                          "x x x x  x x x x   1 1 i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "lfuse"
        size            = 1;
        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                          "x x x x  x x x x   o o o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
                          "x x x x  x x x x   i i i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "hfuse"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                          "x x x x  x x x x   o o o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
                          "x x x x  x x x x   i i i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "efuse"
        size            = 1;

        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
                          "x x x x  x x x x  o o o o  o o o o";

        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
                          "x x x x  x x x x  1 1 1 1  1 i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "signature"
        size            = 3;
        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
      ;

    memory "calibration"
        size            = 1;

        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
        ;
  ;
699  Using Arduino / Microcontrollers / Still no joy... on: November 17, 2011, 01:33:03 am
.... so I reinstalled the Arduino environment to make sure it was pristine, added winavr, so the 1284P is supported (avrdude -p? lists it). I got the AVRISP MKII fully installed including the right USB drivers. However, I lack a avrdude.conf file entry that I can trust.

In the past, I used a conf file entry for the sanguino project (which uses the dip version of the chip, not the TQFP version I am using). That doesn't seem to work. So I wonder whether anyone has a conf file that includes an entry for the 1284P, especially if it's a TQFP version. For example, the Bahbot would be one logical entry since it uses the same chip.

I suppose I could learn to use avrdude to upload the bootloader, but I would prefer the convenience of the Arduino IDE, if possible. Many thanks for any help, Constantin
700  Using Arduino / Microcontrollers / Re: Need Help with TQFP-44 version of 1284P bootloader on: November 14, 2011, 07:43:18 am
FWIW, Ms. Fried appears to think that there are hardware and software issues that prevent her tinyISP from burning a bootloader onto any chip with more than 64kB of flash.

Since I am clueless as to the why, I cannot comment intelligently but I was surprised to read that others had gotten the tinyISP to burn programs (but not bootloaders) onto the affected chips. It makes me wonder if the issue is addressing-related - i.e the bootloader sits on a part of the flash that is 'out of reach' for the tinyISP, an error one would encounter also if one were to burn a program bigger than 64kB onto the chip.

I should also mention that I received a gift certificate this AM from adafruit for my troubles, which was a very sweet gesture. What would be really nifty is if team Adafruit found a way to upgrade their firmware to allow a tinyUSB to address the devices that are currently out of its reach.

Does anyone know if the AVR MkII programmer from Atmel is going to be 'clear' of this issue or is there another programmer I should be looking at? The Atmel pages suggest 100% compatibility... I'll report back once I get it. Many, many thanks again.
701  Using Arduino / Microcontrollers / Re: Need Help with TQFP-44 version of 1284P bootloader on: November 14, 2011, 01:43:09 am
You guys are the best. First of all, I stopped pulling the few of my remaining hairs out. With the help of the link you provided, I was able to confirm that the TinyISP cannot write a bootloader for any device with over 64kB of Flash memory. Even better, I was able to convince Adafruit to prominently mention on the TinyISP web store page that such devices are not supported so others don't follow in my footsteps.

In the meantime, I am waiting for the AVRII programmer from Atmel... I hope that the cores that Mark Sproul put together will work... I also made sure to download Arduino 23, and then I replaced the AVR section with the latest version of WinAVR. So now I should be ready for my shipment from Digikey... Thank you again, I really appreciate the help.
702  Using Arduino / Microcontrollers / Re: Need Help with TQFP-44 version of 1284P bootloader on: November 12, 2011, 09:14:39 am
Oh, and I should mention that the board also has a 328P microcontroller on it. This little guy is designed to communicate via newsoftserial with the bigger Atmel processor. The only other connection between the chips is a shared reset connection. Other than that, they are completely separate. What I do notice though is that as the Bootloader for the 1284P is uploaded, the sck-activity light for the 328P stops blinking. That said, I doubt this is the issue since I was able to upload the bootloader for the 328P just fine.
703  Using Arduino / Microcontrollers / Need Help with TQFP-44 version of 1284P bootloader on: November 12, 2011, 09:10:58 am
Hi everyone,

I decided to implement a 'Arduino-compatible' board using the TQFP-44 version of the 1284P-AU Atmel CPU. The pinouts are identical to the Bahbots controller, but I am having no luck getting the bootloader uploaded. The only difference between the Bahbots implementation and mine is the clockspeed, i.e. my chip runs at 16MHz, vs. 18.432MHz for the Bahbot. I modified the boards.txt file as follows:

Code:
arduino_bahbots1284p.name=Arduino-BahBots 16MHz
arduino_bahbots1284p.upload.protocol=stk500v2
arduino_bahbots1284p.upload.maximum_size=122880
arduino_bahbots1284p.upload.speed=115200

arduino_bahbots1284p.bootloader.low_fuses=0xFF
arduino_bahbots1284p.bootloader.high_fuses=0xD8
arduino_bahbots1284p.bootloader.extended_fuses=0xFF
arduino_bahbots1284p.bootloader.path=bahbots
arduino_bahbots1284p.bootloader.file=BootLoader-m1284p.hex
arduino_bahbots1284p.bootloader.unlock_bits=0x3F
arduino_bahbots1284p.bootloader.lock_bits=0xFF

arduino_bahbots1284p.build.mcu=atmega1284p
arduino_bahbots1284p.build.f_cpu=16000000L
arduino_bahbots1284p.build.core=arduino

I also tried the stk500V2 bootloader that came as part of Mark Sproul's excellent archive. No joy there either. I wonder if enough changed between version 20 of the Arduino software and the current 22 revision that I am using now for that to break something?

Anyhow, my symptoms are pretty simple: I fire up the Arduino IDE to burn the bootloader. The USBTiny upload seems to work fine - the SCK-activity light blinks merrily away. Then it turn steady (on) before turning off and the Arduino ide reports the following error:
Code:
avrdude: verification error, first mismatch at byte 0x1e000
         0x0c != 0xff
avrdude: verification error; content mismatch

So what could I be doing wrong?
704  Using Arduino / General Electronics / Re: How did I manage to damage a linear voltage regulator? on: September 13, 2011, 09:41:57 am
Thanks so much!

I replaced the L4931CZ33 with a MCP1825S that I had lying around. Yes, the latter is a bit bigger than the original L4931CZ33 it replaces but for prototype work it's good enough. The output is a stable 3.3V, so I seem to be OK now. However, the past circuit also produced 3.3V at first, so this is not that comforting. The good news re: the MCP chip is that it is explicitly for use with ceramic caps on the output side. I wonder if the other linear regulator was not as tolerant of having a 10uF and 0.1uF ceramic capacitor combination.

So much to learn. I suppose a 25-100uF 16V Aluminum electrolytic on each output stage would have been a better choice?

As far as input spikes go, I wonder if that's possible since the wall-wart is producing 12VDC that has to pass through the other linear regulator first. I suppose the other regulator may not be doing a great job but the output shouldn't be that high either. Additionally, the L4931CZ33 has a much higher input voltage range than the MCP1825S, and for whatever reason the MCP128S is working fine. I suspect your suggestion re: better ESD practices is spot-on.

Thanks again.
705  Using Arduino / General Electronics / Re: How did I manage to damage a linear voltage regulator? on: September 13, 2011, 06:11:22 am
Thank you so much for the replies to date. I will try to post a circuit diagram later today. But here is a quick word description of what is on the board:

If memory serves, the output of the 5VDC regulator has three 10uF ceramic caps attached to it (in parallel). Another six 0.1uF ceramic caps are distributed across the board to help the various ICs maintain a stable power supply. The 3.3VDC voltage regulator gets it's power from this 5VDC bus. The 3.3V regulator is adjacent to the 5V output of the LM7805 equivalent.

The output side of the 3.3V regulator has a 10uF ceramic cap, as well as two 0.1uF ceramic caps (one for the voltage translator chip, the other for the microSD card holder). Is that enough in terms of capacitors? I would think so based on the data sheet... Should I perhaps have chosen different capacitors?

On the other hand, the static discharge theory could very well explain the issue, though I don't have carpet here and it isn't the height of winter either. Are there more 'rugged' linear regulators than the one I chose in this regard? Many thanks!
Pages: 1 ... 45 46 [47] 48