Show Posts
Pages: 1 2 3 [4] 5 6 ... 52
46  Using Arduino / Displays / Re: OLED 16x2 character display on: June 26, 2011, 05:00:33 pm
"Plugh" worked pretty well, although I'm still in a maze of twisty little passages.

You can make the following mod to the "begin" function in LiquidCrystal.cpp (libraries folder) . . .
Code:
void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
  if (lines > 1) {
    _displayfunction |= LCD_2LINE;
  }
  _numlines = lines;
  _currline = 0;

  // for some 1 line displays you can select a 10 pixel high font
  if ((dotsize != 0) && (lines == 1)) {
    _displayfunction |= LCD_5x10DOTS;
  }

  // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
  // according to datasheet, we need at least 40ms after power rises above 2.7V
  // before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50
  delayMicroseconds(50000);
  // Now we pull both RS and R/W low to begin commands
  digitalWrite(_rs_pin, LOW);
  digitalWrite(_enable_pin, LOW);
  if (_rw_pin != 255) {
    digitalWrite(_rw_pin, LOW);
  }
  
  //put the LCD into 4 bit or 8 bit mode
  if (! (_displayfunction & LCD_8BITMODE)) {
    // this is according to the hitachi HD44780 datasheet
    // figure 24, pg 46

// FOR OLED INIT - Runs before regular init - does not affect non-OLED
write4bits(0x00);
    delayMicroseconds(4500); // wait min 4.1ms
write4bits(0x00);
    delayMicroseconds(4500); // wait min 4.1ms
write4bits(0x00);
    delayMicroseconds(4500); // wait min 4.1ms
write4bits(0x00);
    delayMicroseconds(4500); // wait min 4.1ms
write4bits(0x00);
    delayMicroseconds(4500); // wait min 4.1ms

// FOR OLED INIT - must comment out the 3 0x03 commands . . .
    // we start in 8bit mode, try to set 4 bit mode
    //write4bits(0x03);
    //delayMicroseconds(4500); // wait min 4.1ms

    // second try
    //write4bits(0x03);
    //delayMicroseconds(4500); // wait min 4.1ms
    
    // third go!
    //write4bits(0x03);
    //delayMicroseconds(150);

    // finally, set to 4-bit interface
    write4bits(0x02);
  } else {
    // this is according to the hitachi HD44780 datasheet
    // page 45 figure 23

    // Send function set command sequence
    command(LCD_FUNCTIONSET | _displayfunction);
    delayMicroseconds(4500);  // wait more than 4.1ms

    // second try
    command(LCD_FUNCTIONSET | _displayfunction);
    delayMicroseconds(150);

    // third go
    command(LCD_FUNCTIONSET | _displayfunction);
  }

  // finally, set # lines, font size, etc.
  command(LCD_FUNCTIONSET | _displayfunction);  

  // turn the display on with no cursor or blinking default
  _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;  
  display();

  // clear it off
  clear();

  // Initialize to default text direction (for romance languages)
  _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT;
  // set the entry mode
  command(LCD_ENTRYMODESET | _displaymode);

}

Basically you send 5 (0x00) commands before the standard init and comment out the 3 (0x03) commands.

It needs work however. I see the following issues . . .
  • reset doesn't always work correctly
  • sometimes the line numbers get mixed up
  • the "createChar" function is not working and stops the display from working
I got the above info from NKC, and also a data sheet (attached). The data sheet also has a description of 4 bit init, but I've had no luck with it.

It's a gorgeous display. Highly visable, no contrast or backlight needed, low power.
I hope someone can get the kinks out.
(I was hoping to make an alternate init for this in the sketch and keep the LiquidCrystal lib in tact, but I had no luck with that approach.)



47  Using Arduino / Microcontrollers / Re: Bad Atmega328 chips? on: June 22, 2011, 05:51:15 pm
Just to follow up . . .
I was up to 4 "bad" chips - out of ~50.
Using the same setup described in the 1st post, I did the same operation on another machine - same REL 22 installed.
I was able to bootload and program all 4 of the "bad" chips.
A mystery I'm not inclined to pursue, but just in case it happens to you or a loved one.
48  Topics / Home Automation and Networked Objects / Re: x10 question. on: June 18, 2011, 10:05:44 pm
Alex,
The diagram in the official X10 tutorial is a POS (has problems).
See this post.

49  Using Arduino / Displays / Re: OLED 16x2 character display on: June 18, 2011, 04:39:36 pm
Did the modification to the LiquidCrystal lib for 4 bit operation and "additional commands" ever get published?
50  Community / Bar Sport / Re: RadioShack is listening so shout out arduino if you want! on: May 24, 2011, 02:00:21 pm
I think you both have good points, but you might want to consider RS stores in a different context. By that I mean . . .

There are no less than 10 RS stores in the Denver, US area. These stores, some franchised, maybe some not, compete with each other for the limited hobbyist market. I don't think the market is big enough for any of the stores to make out on this.

Several years ago RS tested a pilot "superstore" idea in Denver. For one who has already admitted to having a very bad attitude towards them, I have to say I was very impressed. They sold wire and cable by the foot, and had 3 guys at a huge parts counter with rows of sleeves behind them.  The sales floor was filled with surprisingly modern stuff of much more of a geeky nature than say a BB.

It would seem like this idea would work - one big store in the city and let the others sell their door chimes and walkie talkies.
It would  seem, but I guess it didn't to corporate. They closed the store after about a year.

Too bad. It was our only hope, Obi-Wan.

51  Using Arduino / Microcontrollers / Re: Bad Atmega328 chips? on: May 23, 2011, 09:58:29 pm
Oh (x2) "Arduino Duexxx or Nano w/ATmega328"
52  Using Arduino / Microcontrollers / Re: Bad Atmega328 chips? on: May 23, 2011, 09:23:42 pm
Oh, - it was just just the standard bootloader loaded from Tools in the IDE. I think the bootloader loaded fine. Got the flashing LED. Just couldn't uplaod a sketch after that. Same as your problem. If it was only one chip I'd just say it was a fluke. But 2 & yours - it's a pattern!
John
53  Using Arduino / Microcontrollers / Re: Bad Atmega328 chips? on: May 23, 2011, 05:43:53 pm
Jack,
Looked over your post and yes it sounds very similar. I didn't give the crystal part a real close read - my proto board uses 22pF caps and I have the same problem if I put the chip in the Arduino. I don't have the inclination to spend the time trying to get 2 out of 30 chips working by futtizing around and loading sketches with the ISP. If they not going to work like all the rest, I don't want to deal with them. Good luck on getting your going, however.  smiley
54  Community / Bar Sport / Re: RadioShack is listening so shout out arduino if you want! on: May 23, 2011, 12:05:07 pm
Here's a little history on RadioShack - in case someone finds it interesting.

Once upon a time, there was a company called Allied Electronics. They were the largest electronic parts supplier in the world. They had a consumer electronics division called Allied Radio. They also had a division called Knight that sold kits and assembled items.

In 1968 (when I was working there) they were bought out by Ling-Temco-Vought who, at that time, made everything from jet planes to steel, to basketballs.

Within a month or two LTV re-sold Allied to Tandy Corp. who had a chain a stores for leather-work hobbyists and a chain for bubble pack electronic parts called RadioShack. Allied was merged with RadioShack and became known as Allied-RadioShack. RadioShack continued to be the disappointing parts supplier that it is today.

Somewhere along the line a little bit of Allied Electronics was left partially in tact.

Having worked at Allied in Chicago during it's glory days, I'd admit to having a very bad attitude about RadioSh**. I do go there when I absolutely have to, but have trouble getting through the door due to the enormous chip on my shoulder.
55  Using Arduino / Microcontrollers / Re: Bad Atmega328 chips? on: May 23, 2011, 11:01:28 am
Thanks CB,
I loaded the bootloader several times on these chips and even checked them with Avrdude. The fuses look fine.
They just won't accept an upload. Must be a problem with the UART or something.
56  Using Arduino / Microcontrollers / Bad Atmega328 chips? on: May 21, 2011, 01:51:03 pm
Hi you all,
Twice now I've had the problem where I can burn the bootloader on a chip but it won't accept an upload. My situation is this:

I made a little board with a ZIF socket with ISP and FTDI connections. When I need to program a batch of chips, I burn the bootloader from the IDE with a USBtinyISP, then switch to a FTDI cable and upload the program with the IDE. This works great, but in two batches of chips now, I found one that would take the bootloader but not upload the program (resp = 0 IIRC). Putting the chip in the Arduino = same.

Does anyone know of something to try to bring these two chips to life? (They were brand new - one from DigiKey and one from Sparkfun.)  I guess it's possible that the Rx & Tx pins are not working, but I want to make sure before I toss them. (They are, after all, the soul of the Arduino.)

Thanks
John
57  Using Arduino / Project Guidance / Re: Cat Sprayer on: May 19, 2011, 06:51:40 pm
This?
58  Using Arduino / Microcontrollers / Re: Using the FTDI on the Nano to load another ATmega? on: May 14, 2011, 04:50:43 pm
It's about time I got an an answer! It was almost 5 minutes.  (2 no less!)
Thank you both. That makes sense.
John
59  Using Arduino / Microcontrollers / Using the FTDI on the Nano to load another ATmega? on: May 14, 2011, 04:41:52 pm
Is it possible to use a 5V Nano only as an FTDI to load an ATmega328 that is on a breadboard?

I know you can use the FTDI chip on an Arduino that has a removable chip, but does having the ATmega328 soldered in on the Nano prohibit this? (i.e Would you be trying to load 2 uCs at the same time?)

If anyone has experience with this, I'd appreciate hearing about it.

Thanks,
John
60  Community / Bar Sport / Re: Your latest purchase on: May 12, 2011, 11:01:35 pm
Not at all, click the link under the picture.
Pages: 1 2 3 [4] 5 6 ... 52