Show Posts
Pages: 1 [2] 3 4 ... 581
16  Using Arduino / Project Guidance / Re: Automatic plant watering system on: April 19, 2014, 10:04:51 pm
Something like this I would think

http://www.ebay.com.au/itm/Ultra-quiet-Mini-DC-12V-3M-240L-H-Brushless-Motor-Submersible-Water-Pump-New-/231021868292?pt=LH_DefaultDomain_15&hash=item35c9f9f504

It's 12v though, any reason you can't use 12v?

______
Rob
17  Using Arduino / Project Guidance / Re: Automatic plant watering system on: April 19, 2014, 06:48:29 pm
Quote
Would a pump like this fit the bill?
That pump looks like it's designed to be mounted directly onto a tank, much like the car windscreen washers we talked about before. In most situations that would not be appropriate as it's a lot easier to connect a pump with proper in/outlets.

______
Rob
18  Using Arduino / Project Guidance / Re: Senior Project Multi-Processor Arduino Board on: April 19, 2014, 06:31:05 pm
Yeah I remember talking about doing that.

Using FIFOs or DPRAM would just be a fun thing to play with, total overkill for a dual AVR board though, a bit like having the Nürburgring or Daytona to yourself and doing laps in a Prius.

______
Rob
19  Using Arduino / Project Guidance / Re: Senior Project Multi-Processor Arduino Board on: April 19, 2014, 07:42:19 am
Quote
Multiple processors should only be introduced if there is a need to do more than one thing at the same time, not just to improve speed.
Yes that's true, especially given the range of fast CPUs these days, multi-CPUs is a pet hobby horse of mine and even I struggle to justify it and for simple speed increase I can't at all.

In areas like offloading time-consuming IO (like the Lynxmotion SSC-32 Servo Controller) or maybe handling a complex serial protocol (technically the W5100 or FT232 are co-processors) I think there's a place for them.

______
Rob
20  Products / Arduino Due / Re: Bill Of Materials (BOM) required for Arduino DUE on: April 19, 2014, 03:16:48 am
Arduinos are open source right? So is there not an official BOM and correct schematic available?

______
Rob
21  Using Arduino / Project Guidance / Re: Senior Project Multi-Processor Arduino Board on: April 19, 2014, 03:10:15 am
For two CPUs some FIFOs  or dual-ported RAM would be fun to play with.

I'm currently working on a system that can have a master and 15 co-processors, loosely coupled with either SPI, UART or I2C.

Don't ask my why you would need 15, it just seemed like a nice round number smiley

______
Rob
22  Products / Arduino Due / Re: Small-footprint Due on: April 19, 2014, 02:55:17 am
You want to be careful about feature creep, I've done two Due-compatible designs now and in both cases they got too big and complicated so I ditched them.

OTOH it's a shame not to have all the SAM features smiley

______
Rob
23  Using Arduino / Programming Questions / Re: Having issues using an Arduino to emulate a shift register. Details inside. on: April 18, 2014, 06:29:04 pm
Thanks, that gives me a better idea of what's going on.

Looking at the 4014 data sheet I'm not convinced that code is right, presumably it does work but everything is done on the clock's rising edge not on the load edge.

Anyway I've done a new version.

Code:
// S88 pins setup
#define S88DATAIN 5
#define S88DATAOUT 4
#define S88CLOCK 2
#define S88LOAD 3

#define N_REGS 2
#define N_BITS (N_REGS * 8)

byte S88DataOutShiftRegister[N_BITS];
int rd_index = 0;
int wr_index = 0;

// S88 test data, when this works completely I want to add the wireless stuff to manipulate this data array.
uint8_t S88data[N_BITS] = {
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1
};

void setup() {
  attachInterrupt(0, CLOCK, RISING); // Interrupt stuff for the CLOCK
  pinMode(S88DATAOUT, OUTPUT);
}

void loop() { // No loop stuff because it's all interrupt driven.
}

void CLOCK() {

byte dataInBit = (PIND >> S88DATAIN) && 1;
byte loadBit = (PIND >> S88LOAD)  && 1;

if (loadBit) {    // LOAD (PE pin on 4014) is asserted
// put the test data into the FIFO
for (int i = 0; i < N_BITS; i++) {
S88DataOutShiftRegister[i] = S88data[i];
}
rd_index = 0;
wr_index = 0;
} else { // LOAD is not asserted
// Get bit from upstream unit and add to FIFO
S88DataOutShiftRegister[wr_index++] = dataInBit;
wr_index = wr_index < N_BITS ? wr_index : 0;
}

// setup data out so it's at the right level for the downstream unit when the next clock occurs
if (S88DataOutShiftRegister[rd_index++])
PORTD |= (1 << S88DATAOUT);
else
PORTD &= ~(1 << S88DATAOUT);

rd_index = rd_index < N_BITS ? rd_index : 0;

}

As you say I don't have that gear so can't test it, I can't really set up two Arduinos (or indeed any hardware) right now either as I'm in the process of building my workshop and everything is in total disarray.

Anyway you don't have to go this way of course, you may feel more comfortable with the more inline approach used by GuyA's code, but it's worth plugging this in to see what happens.

______
Rob
24  Products / Arduino Due / Re: Building an LCD TFT library for Arduino DUE on: April 18, 2014, 06:18:05 pm
Have you got a frame rate (or update time) for drawing a full bitmap?

______
Rob
25  Using Arduino / Networking, Protocols, and Devices / Re: Serial communication (Arduino Mega 2560) on: April 18, 2014, 03:29:25 am
Quote
Moreover, the Serial1, Serial2 and Serial3 functions do not give any output on the screen.
Are they connected to a serial port on the PC? If so how, because that would require 3 USB->serial converter cables or dongles.

______
Rob
26  Using Arduino / Programming Questions / Re: Having issues using an Arduino to emulate a shift register. Details inside. on: April 17, 2014, 10:29:11 pm
Just thinking off the top of my head here, this code should be a lot faster, it only implements the shift reg part not LOAD which AFAICT did nothing yet anyway as there was no code to output to the parallel pins. With no outputs to the parallel pins how are you testing this?

Code:
// S88 pins setup
#define S88DATAIN 5
#define S88DATAOUT 4
#define S88CLOCK 2
#define S88LOAD 3

#define N_REGS 3
#define N_BITS (N_REGS * 8)

uint16_t S88DataOutShiftRegister[N_BITS];
int rd_index = 0;
int wr_index = 0;

void setup() {
  attachInterrupt(0, CLOCK, CHANGE); // Interrupt stuff for the CLOCK and LOAD
  attachInterrupt(1, LOAD, RISING);
  pinMode(S88DATAOUT, OUTPUT);
 
  for (int i = 0; i < N_BITS; i++) {
S88DataOutShiftRegister[i] = 0;
  }
 
}

void loop() { // No loop stuff because it's all interrupt driven.
}

void CLOCK() {

byte dataBit = (PIND >> S88DATAIN) && 1;
byte clockBit = (PIND >> S88CLOCK)  && 1;

if (clockBit) {   // If rising edge, write top FIFO bit to S88DATAOUT
if (S88DataOutShiftRegister[rd_index++])
PORTD &= ~(1 << S88DATAOUT);
else {
PORTD |= (1 << S88DATAOUT);
}
rd_index = rd_index < N_BITS ? rd_index : 0;

} else {   // If falling edge, read S88DATAIN -> Put the data into the FIFO
S88DataOutShiftRegister[wr_index++] = dataBit;
wr_index = wr_index < N_BITS ? wr_index : 0;
}
}

void LOAD() // Setup the S88data arrays / shift registers... Now it's ready to be send!
{
}

I'm pretty sure it will be faster to represent the bits in a byte array, that way there is no shifting of them every time you get a new bit. And my making that array a FIFO there is nothing to do but update the read and write index variables.

I'm sure there is still much room for improvement, this is just a first pass.

______
Rob
27  Using Arduino / Programming Questions / Re: Having issues using an Arduino to emulate a shift register. Details inside. on: April 17, 2014, 09:52:57 pm
Quote
I thought about seeing if there's a sketch for Arduino to make it a logic analyzer, and maybe that'd help give me a little insight.
I believe there are such sketches, they won't be very fast I think but it would be worth having a look.

A logic analyser is the most useful tool you can have for embedded work, hands down. You can get a Saleae Logic 8 for $149 (less for the new 4-channel one) or a clone of it for about $20. I prefer to support the Saleae guys, but if you don't have the cash you can get the clone and still use the Saleae software.

Quote
directly manipulate the pins so I can pump the data out faster. I don't know if that'd solve the problem though. I've read there's some overhead with using digitalWrite as opposed to direct manipulation.
The code is already using direct manipulation, so in that respect there is nothing to be gained. Yes the code is simple but also quite inefficient I think. Interrupts are not the fastest way to do this and all those shift operations will be slow. There must be a better way but I haven't thought of it yet.

______
Rob
28  Using Arduino / Programming Questions / Re: Having issues using an Arduino to emulate a shift register. Details inside. on: April 17, 2014, 07:36:38 pm
Quote
Maybe the Arduino isn’t fast enough to keep up with the controller?
How fast is the incoming data?

How about you post the actual code you are using, or is it the same as GuyA's?

I haven't analysed it yet but that code does not look too clever to me, there is a HUGE amount of <<'s involved and an ISR is not the fastest way to do stuff either.

______
Rob
29  Using Arduino / Microcontrollers / Re: FT232 vs 16u2 on: April 17, 2014, 01:56:04 am
Yeah all good points, so historically it made sense, just not so much any more.

______
Rob
30  Using Arduino / Microcontrollers / Re: FT232 vs 16u2 on: April 16, 2014, 10:35:33 pm
Long  answer: Because it looks like a serial port to the PC application I can only assume they did what most people do, equate "serial" with "RS232", either because they didn't know any better (unlikely) or maybe as a marketing ploy because they knew most people make that connection.

I can't really think that either of those options is likely, after all anyone designing a board with these chips would know the difference and certainly those designing the chip would know.

So that brings me back to a marketing reason.

Short answer: No idea smiley


______
Rob
Pages: 1 [2] 3 4 ... 581