Show Posts
Pages: [1] 2 3 ... 11
1  Using Arduino / Project Guidance / Re: G Code on Arduino? on: Today at 06:26:48 pm
I've spent some time developing on teacup and other printer firmwares.

Teacup does not seem to support SD card, as that would be an easy way to inject G-code commands.

The next easiest is to inject characters in the main () function (file mendel.c). Currently it looks like this:

Code:
// if queue is full, no point in reading chars- host will just have to wait
if ((serial_rxchars() != 0) && (queue_full() == 0)) {
uint8_t c = serial_popchar();
gcode_parse_char(c);
}

if you add something like the following psuedocode :
Code:
  if queue is not full
        c = get next char from my buffer at next_ptr
       gcode_parse_char (c)
       next_ptr ++
       if next_ptr end of my buffer
           set next_ptr to 0
       endif
  endif

it will repeatedly run the built-in G-code commands.

You can store a "script" of G-code commands as a simple progmem array something like

Code:
PROGMEM char my_gcode [] = "G1 X10 Y10\nG1 X20 Y20\n G1 X0 y0\n";

next_ptr can just be an int, going from 0 to strlen(my_gcode).

If you want to get fancy you could add G-code commands to start/stop your script, run different scripts, react to buttons, etc.

There is a G4 command if you want to put pauses in to the script.
2  General Category / General Discussion / Re: Arduino Newbie on: Today at 04:06:14 pm
I think we are talking cross purposes. I didn't mean "why are people picking on Intel" - they seem to be fair game!

What I meant was, there have been several newbies with Galileos, asking how to use them. I am just wondering where and why they got them - giveaways, universities, RS/Farnell, sales reps at work?

Because I think if you went to any Arduino-friendly hobby store/maker type place, people probably wouldn't come out with a Galileo.

Microsoft will be giving away Gen 2 Galileos running Windows, not sure if there is any Arduino involved, but I guess there will be the inevitable questions.

3  Using Arduino / LEDs and Multiplexing / Re: Strange RGB LED on: Today at 12:53:53 pm
That was indeed the problem. Kind of nuts. This is the result of having the wrong LED and having it hooked up wrong?  I am expecting to order a lot of 50-100 for a project. Is this type of thing common?

If you buy cheap stuff from China, yes smiley

A colleague bought an iPhone car charger off ebay. Being a curious sort, he opened it up to see what regulation was used. There was none! 12V was wired direct from input to output.

Buying in volume seems to provide an opportunity to hide wrong spec/faulty parts, in some cases I've heard of 50% failure rates.
4  General Category / General Discussion / Re: Arduino Newbie on: Today at 12:37:31 pm
I am slightly puzzled where people are picking up on Intel Galileo. Obviously Intel have a big marketing machine and can push sales down lots of existing channels, unlike Arduino which has much different community.

Where Intel's marketing side are succeeding, I agree the engineering side is lacking. The Galileo Gen2 not much better than it's predecessor. The Galileo is not cheap either.

For your application, an AVR Arduino would be fine.
5  Products / Arduino Due / Re: Library for Arduino Due & Serial Flash communication over SPI? on: Today at 12:24:26 pm
Some puzzling commits in that repo. The maintainer merges a pull request, then the same day rips out all those changes and adds new stuff which breaks compatibility.  smiley-confuse

I suggest if you take the version at Merge pull request #3 from PaulStoffregen/master it will work ok on Due.
6  Products / Arduino Due / Re: Question on pwm using due on: August 27, 2014, 01:23:14 pm
For the PWM, the actual clock rate is the PWM frequency times the PWM count. For an 8 bit resolution, the count is 255.

Therefore the max PWM frequency with 8 bit resolution is MCK/255, as you have found.
7  Using Arduino / Microcontrollers / Re: Using an ATtiny85 as SPI Slave on: August 27, 2014, 01:11:15 pm
I was thinking of adding an SPI protocol to the cyz_rgb firmware, so I might have go with this.

However, I would really try to avoid putting delays into SPI transactions. The slave should return data it has already calculated, or the master should disconnect and then poll a status register until the slave indicates it is ready. Pausing the SPI transfer is somewhat impossible with a hardware SPI.

At a pinch, you could insert a padding byte or two into the transaction to allow the slave some time, but you always have to draw the line somewhere.

8  Using Arduino / Project Guidance / Re: Can I use a Arduino uno as a LPT port for laptop? on: August 27, 2014, 12:50:32 pm
this is just an alternative way of reading the nand flash through lpt

I have looked into lpt emulation because we have legacy applications at work that use parallel ports and laptops without parallel ports. The short story is that it is impractical to do. The only practical option is to get a PC with a PCI parallel port card, if you want to use LPT, or to ditch it and buy new stuff that works over USB (what we did).

The USB to parallel cables don't work for general use because they only work with printer drivers. For PC applications that expect to find parallel port registers at 278 or 378, you would need to write a kernel driver to emulate the registers, invent a protocol to transfer data over USB, write the firmware for a USB device...

So my advice is forget LPT completely. nandpro supports a USB device, if you want to get stuff done, use that.

If you want to write a nand flasher for educational reasons it would be a fun little project, but it doesn't appear that nandpro provide source code, so you would probably have to write the application side as well.

The Hynix NAND chip is fairly easy to interface to. Decoding the flash file system might take some coding. Overall quite doable, but probably not something I would recommend as first project, unless you already have experience with programming flash chips.
9  Products / Arduino Due / Re: General Due Question on: August 26, 2014, 06:45:11 pm
You could also add an external EEPROM module AT24C256, http://www.dfrobot.com/index.php?route=product/product&product_id=429

Either way you will probably need to edit the sketch accordingly.

Does anyone have a link to the EEPROM emulation library for the Due? I couldn't find it via google.
10  Products / Arduino Due / Re: How to store Data fast in RAM on: August 25, 2014, 06:47:25 pm
1MB/sec to write on a sdcard is possible with DUE, imho. You need to buffer the data into an fifo to eliminate the sdcard's write latency.
That fifo buffering while writing to an sdcard has been discussed dozen times on this forum already.

Maybe, but SD cards can pause for long times, 100ms (or longer!) is possible . At 1MB/sec that means buffering up to 100k of data in 96k of RAM...

However, data compression can often cut down the data rate significantly, which might make some things more feasible.
11  Using Arduino / LEDs and Multiplexing / Re: Controlling LEDs from MATLAB with less than 1ms execution delay? on: August 25, 2014, 03:02:49 pm
adioes.pde appears to be part of a Matlab package Arduinoio (sic)

My guess is that it allows remote operation of an Arduino via Matlab. With comms going over USB serial, the absolute minimum delay is going to be 2ms (since USB serial is polled every 1ms, command out + response back).

So what you need to do is to get the Arduino to measure the delay and report back to the Matlab program. The Arduino side is easy, the Matlab side should be too, you just need to open a tty device as a file then write/read data - I don't know what the commands are in Matlab.

ETA This might help http://www.mathworks.co.uk/help/matlab/matlab_external/creating-a-serial-port-object.html
12  Using Arduino / LEDs and Multiplexing / Re: Design Challenge: 64x64 led matrix as cheap as possible on: August 25, 2014, 08:36:51 am
We can also throw MAX7219 (36p each, 10pcs ebay) and TLC5940 (53p each, 10 pcs ebay) in to the mix... at which point my brain becomes full and there are almost too many possibilities to consider.

So... I am wondering what the solution to the challenge was ?
13  Products / Arduino Due / Re: How to store Data fast in RAM on: August 25, 2014, 07:40:22 am
Following the answers (thanks!) things now appear  a little bit clearer to me.
My problem is the high amount of storage because the measurement time is about 2-3 minutes. That means the necessity of about 150s*1MB/s=150MB. That's why internal storage is far away from being great enough.
Therefore I need external RAM or SSD. Has anyone got experience with connecting SSD and DUE?

That is a pretty tough target for a Due. SSDs usually have a PCI or SATA interface, not available on Due. At a pinch you might be able t o use a USB mass storage device, not sure that would give a better performance than SD.

Serial SD is quite slow, the SAM3X has a high-speed SD interface, not used on Due. I have seen it in use on the Duet board though, a Due variant designed for 3D printing. SD cards tend to have long unpredictable pauses anyway because of their onboard  controller.

Unfortunately the Due does not bring out the external memory bus on the SAM3X, which would allow easy access to large RAM or Flash.

I think your best bet for a DIY solution with the Due would be an SPI connected NOR Flash, e.g. http://uk.rs-online.com/web/p/flash-memory-chips/8096901/. You will need at least 3 to get 150MB, I would connect 4 and interleave writes so you should be able to achieve 1MB/sec. SPI bus will be a bottleneck I think.

Otherwise you could look at the Duet, it is mostly Arduino compatible. There is nothing else suitable in the Arduino environment I can think of. The boards with big memories (IOW, Linux capable) require some serious bare-metal coding. I know there is some bare-metal stuff for Raspberry Pi, that might be worth looking at.
14  Products / Arduino Due / Re: Is the Due fast enough for BLDC commutation? on: August 24, 2014, 05:48:36 pm
I get 1.07us for digitalRead, 1.25us for digitalWrite, both on version 1.5.6

Note that benchmarking the Due is rather hit and miss due to the cache.

Ok, I get 2.44 us from a scope trace on 1.5.6-r2. How are you measuring it?

I believe the Due does not have a cache.
15  Products / Arduino Due / Re: Is the Due fast enough for BLDC commutation? on: August 23, 2014, 06:42:09 pm
To see how slow digitalWrite is, have a look at this thread http://forum.arduino.cc/index.php?topic=129868.msg1007525#msg1007525. It takes about 2.5us, or about 200 instructions.

OTOH, writing to an output port can be one instruction, but it takes 2 cycles for the output pin to be set.
Pages: [1] 2 3 ... 11