Show Posts
Pages: 1 [2] 3 4 ... 10
16  Using Arduino / Displays / Re: Driving larger LCDs on: July 13, 2012, 05:24:46 pm
Your cheapest option would be an SSD1963 at ~$7 from techtoys HK. Other options include an ARM with an LCD interface, a CPLD or an FPGA.
17  Using Arduino / Displays / Re: Driving larger LCDs on: July 13, 2012, 01:41:10 pm
What about a LCD display like this one:
https://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2157554_-1

It says it includes the driver but no controller.  What would you need to do for a controller to be able to use that screen with an arduino or even a netduino project?

It's not physically possible to drive that with an Arduino. The pixel-clock needs to be ~10Mhz and you'd need to constantly supply data to the display at that frequency from a framebuffer that you don't have.
18  Using Arduino / General Electronics / Re: Placement of resistors. on: July 05, 2012, 07:40:51 am
I've tried the solder drag method before.  I ended up with all the pins connected to eachother.  I stopped there.  Was I supposed to wick away the excess after that?

It depends a lot on the type of flux. I have just about every type you can get; no-clean liquid, rma223 and others. All will leave bridges except this dark brown gunge I've got that burns really easily. It's ability to completely destroy the surface tension of solder is uncanny and not once has it caused a bridge even on 0.4mm pitch parts.

It will even eliminate other bridges if I paste a bit on the bridge and touch it with the iron. I'd like to know what it is, maybe it's plumbers fluxite or something like that.
19  Using Arduino / Programming Questions / Re: Arduino resets unexpectedly - NOT running out of SRAM on: June 27, 2012, 04:53:59 pm
Anyway, as soon as I see the String class, I can see a very large potential problem. Especially here:

Code:
String listenForInstruction(){
  String inst;

Every time this function is called it makes a String, and then it returns one. So this is thrashing strings.

That is not always true. gcc will try to do the return value optimization permitted by the C++ standard. That means that no copying takes place and the actual object instance allocated on the stack inside the function is the instance returned to the caller. This is not a commonly known part of the standard. Try it and see!
20  Using Arduino / Programming Questions / Re: analogRead seems not working into a class constructor on: June 24, 2012, 02:27:51 pm
If your class instance is declared at global scope then the constructor will be called before main() and in an undefined order relative to other global constructors.

main() is where the arduino library calls init() and only after that can you use the analog functions. Therefore you cannot use many of the Arduino library functions from constructors on objects declared at global scope. If this puts you off globally declared objects then your software design skills just went up a notch  smiley-wink

If you absolutely must have a global variable then you could make it a pointer and allocate it with new in your setup() function.
21  Using Arduino / Programming Questions / Re: static structure deceleration not working in C++ on: June 22, 2012, 03:07:52 pm
Your syntax is slightly off. There are a couple of ways to initialise struct members to default values. The old way is { 0 } the new way is PDU(). I flipped a coin and will show the old way. The following compiles:

Code:

struct PDU
{
byte dsap;
byte ptype;
byte ssap;
byte sequence;
byte payload[256];
};

class LLCP
{
public:

static PDU pdu;

static void receive();
};

PDU LLCP::pdu = { 0 }

void setup() {
}

void loop() {
}
22  Using Arduino / Programming Questions / Re: Looking for best way to create HashTable for lookup data on: June 20, 2012, 07:27:15 am
If you prefer to deal with numbers then there are optimized CRC functions in <util/crc16.h> that you can use on the string. Assuming you don't get any collisions in the 274 possible inputs then you could create a table suitable for using bsearch on.
23  Using Arduino / Programming Questions / Re: Issue with passing objects to function on: May 07, 2012, 06:05:46 am
Your function pointer needs to be scoped to the class it's coming from. Adapt your code to this general pattern and it will work.

Code:
struct foo {
  bool func() {}
};

void bar(bool (foo::*)()) {
}

void usage() {
  bar(&foo::func);
}

Note that you can use plain function pointer syntax if you make the method static.

EDIT: since this area of C++ is one of the more mind-bending in terms of syntactical gymnastics. Here's a more complete example with an actual call being made:

Code:
struct foo {
  bool func() {}
} myfoo;

typedef bool (foo::*funcptr)();

void bar(foo& objref,funcptr methodptr) {
  (objref.*methodptr)();
}

void usage() {
  bar(myfoo,&foo::func);
}
24  Using Arduino / Programming Questions / Re: Andy Brown's STL port and Arduino 1.0 [solved] on: May 02, 2012, 06:46:29 am
@milkman

Change around the order of your includes for vector and iterator so that iterator comes first.
25  Using Arduino / Programming Questions / Re: SRAM and storing strings on: April 09, 2012, 06:23:11 am
Nevermind... it's an avr-gcc bug.

Yes, and a highly annoying one too. I compiled it out of my copy of avr-gcc 4.5.1. With it in there I could not use my preferred flags of -Wall -Wextra -Werror because there's no specific command line flag to disable it and gcc as a policy does not use pragmas to control warnings.

26  Using Arduino / Programming Questions / Re: malloc(), realloc().. the dark side powerful it is on: April 05, 2012, 03:00:56 am
Nice work everyone, particularly Nick. I upgraded my libc version from 1.6.x to 1.7.x a long time ago when I recompiled avr-gcc up to 4.5.1 to get some other bug fixes and enhancements so yes, on my website you are seeing the results of 1.7.x free().
27  Using Arduino / Programming Questions / Re: Declaring class objects within a class on: March 22, 2012, 04:30:46 pm
Are you looking for this sort of arrangement?

Code:
class Trunk {
};

class Foot {
  public:
    Foot(int a) {}
};

class Elephant {
  private:
    Trunk t;
    Foot f1,f2,f3,f4;
   
  public:
    Elephant()
      : f1(1), f2(2), f3(3), f4(4) {
    }
};
28  Using Arduino / Programming Questions / Re: Alignment on: November 06, 2011, 05:06:26 am
gcc doesn't support the pack pragma. Here's how you do it with gcc, taken from some filesystem code I wrote:

Code:
struct Mbr {
  uint8_t code[440];
  uint32_t diskSignature;
  uint16_t reserved1;
  MbrPartition partitions[4];
  uint16_t signature;
} __attribute__ ((packed));
29  Using Arduino / Displays / Re: ITDB02-3.2WC with Arduino Mega, resistors? on: October 27, 2011, 01:53:52 pm
These are the signal connections for the TFT part of the board:

DB0-DB15
REST
RS
WR
RD
CS

They all need to be driven at 3.3V, hence a resistor is required on each one when used with a 5V arduino or you will destroy the board.

In addition to these, connect up directly:

VCC=3.3V
GND = GND
LED-A = 5V

The ILI9327 is a nice one to work with, the data sheet is very good. The only annoyance I found is that the commands and parameters resolutely stick to 8-bits to be MIPI-compliant requiring multiple transfers when there's a nice 16-bit wide bus available.

Don't worry about the SD or the touch screen yet because you've got a big enough task ahead getting the LCD to work though I can tell you that SD levels are 3.3V.
30  Using Arduino / Displays / Re: I am going to do it, connect up this 40 Pin LCD! No matter what! on: October 26, 2011, 02:36:56 pm
Firstly you can forget SPI. Yes the HX8347-A supports it, but the mode selection pins are not exposed by the PCB it's attached to. It's hardwired to 8080 18-bit parallel mode, though the seller seems to think it's 16-bit which is contradictory to both his own picture and the data sheets. The SPI pins on the 40-pin connector are for the SD card connector that's fixed to the back.

I enjoy buying these type of TFTs on ebay and have got them all to work, but only with an ARM Cortex M3 controller, not an Arduino. To get this to work you are going to have to control DB0-DB17, PSB (looks like CS which you can pull-up along with RD because you don't need them), RW (should be named /WR), /RS and /RESET.

You'll have to bit-bang the timings for the transfers - you'll find those in the datasheet and you'll need to get the commands and delays for the post-reset startup sequence correct or nothing at all will happen. Finally, all the signal levels are 3.3V so you'll need a level-converter and have to take into account its impact on the timings.

It's possible, but really you picked the wrong microcontroller for this job.
Pages: 1 [2] 3 4 ... 10