Show Posts
Pages: [1]
1  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: February 07, 2014, 03:51:58 pm
Did you look at the example provided in the library (S1D13700_LCD)?  It is using one address bit to communicate with an external parallel LCD...  I haven't tested that in a while, but it was working when I posted the code.  If not, then perhaps something has changed in the Arduino config since then?


i am using this parallel library to drive a LCD display. I am using one address line to toggle the RS line of the display.

Unfortunately i do not get the first five address lines to work. The first address line that is working as expected is line A5. A0-A4 stay constantly high.

So my display works fine if i use line A5 (and 5-times faster than using ports), thanks for the work!

But i would like to use A0 (pin 9) instead of A5. Any idea how i can get A0 working? Any trick how to enable A0/C.21/PWM9?
2  Products / Arduino Due / Re: ASF functions inside Arduino ide on: May 15, 2013, 05:23:56 pm
Yes, most functions work. You don't need any headers ofzo.

I'd qualify Gericom's comment a bit.  There is some support for the lower level stuff in ASF (i.e peripherals).  However, not everything is there and I don't think that much of the middleware in ASF is in the distro, although you may find some in the libraries folder for the various drivers that are supported. 

In addition to the libraries you'll want to look in the folder hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/include/component/ to see what has been compiled into the libsam_sam3x8e_gcc_rel.a library that sketches get linked with.  If what you need isn't in there you can always bring it in.
3  Products / Arduino Due / Re: Programming Bare SAM3X Chip on: May 14, 2013, 04:32:10 pm
Are Y1 and Y4 both supposed to be 16MHz, or just Y4?

My DUE board has Y1 @ 12MHz and Y4 @ 16MHz.
4  Products / Arduino Due / Re: RTOS hooks on: May 14, 2013, 04:15:44 pm
It needs to be in an extern "C" { ... } block, eg
extern "C" {
  int sysTickHook(void)
    return 0;

Yep, that did the trick.  Thanks for the quick reply...
5  Products / Arduino Due / Re: RTOS hooks on: May 14, 2013, 03:52:13 pm
I realize that this thread is a bit old, but I quickly tried getting this running today on 1.52 and wasn't having much luck.  I added the following code as a cpp file to my project:

#include <Arduino.h>

int count = 0;

int sysTickHook(void)
  return 0;

It doesn't seem that this code is being called.  What am I missing?  Thanks for the help...
6  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: March 08, 2013, 05:12:38 pm

One last request: a getAddr() method smiley

This is so that you can access the memory mapped peripheral directly without incurring the overhead of read/write?  If so, that seems like a reasonable request.  I realize that the current code isn't as efficient as it could be because I opted for simplicity.  Perhaps there is a better way I could have implemented it that would achieve both.  I'll noodle on that.

In the meantime, you can grab the new code with getAddress() on github
7  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: March 07, 2013, 06:19:10 pm
Thanks smiley If you add the addresses to the library I'll check it with a SRAM.

New code posted up on github.  Now you can have all 16 data pins and 23 address pins if you wish.  Note that you can't have A5 and NRD since the pins are wired together.  You'll need to operate without NRD if using A5 or cut the trace on the bottom of the board that ties the two pins together.
8  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: March 07, 2013, 10:08:51 am
Here are most of the SMC pins and how they are connected.  I left out the NAND flash stuff and didn't double check for accuracy...

Address Bus:

Function Chip PinArduino Pin
A10PD0PIN 25
A11PD1PIN 26
A12PD2PIN 27
A13PD3PIN 28
A16PD6PIN 29
A22PD9PIN 30

Here is the data bus:

Function Chip PinArduino Pin
D10PC12PIN 51
D11PC13PIN 50
D12PC14PIN 49
D13PC15PIN 48
D14PC16PIN 47
D15PC17PIN 46

And the control signals:

Function Chip PinArduino Pin
NRDPA29(also tied to PC26 on PCB, which is A5)SS1/PWM4

There isn't too much you can do with the A5/NRD problem in software since the two pins are wired together on the PCB (I am not sure why those pins are wired together...)  If you were careful, you could cut the trace on the bottom side of the board...

I can pretty easily add all the pins to the library and let the user sort out any conflicts.
9  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: March 07, 2013, 01:14:10 am
It would have been a nice surprise to see an address/data bus pinned out, but this was the first foray for the Arduino folks into a much more complicated processor.  The overall goal of simplicity is critical and I guess this feature wasn't above the bar for the first ARM board.  It's certainly a balancing act to get everything in there. 

On top of that, this part isn't nearly as configurable as some of Atmel's homegrown 32-bit parts, the UC3 family.  In those parts each function can go to sometimes as many as 6 different pins.  In the SAM3X, many functions only have a single pin option, maybe two if you're lucky.

Anyhoo, there is still some limited use of the EMB/SMC in the current DUE...
10  Products / Arduino Due / Re: Arduino Due libraries (official and 3rd party) on: March 06, 2013, 05:19:39 pm
I created a simple external memory interface/static memory controller.  Because of some HW limitations, it's not a full bus interface but can be used for interfacing with parallel LCDs.

More info here:,152644.0.html
11  Products / Arduino Due / Parallel library for Due External Memory Bus/Static Memory Controller on: March 06, 2013, 05:16:36 pm
This library enables the External Memory Bus/Static Memory Controller on the Arduino Due board. It's more of an external memory interface than a true parallel port.

The DUE board pins out the data bus on the extended digital headers (D0-D7:PIN34-PIN41) along with the control signals NCS1 and NWR. Some of the address signals are connected to the PWM pins (A0-A5), but a full address bus is unavailable. There is also conflict between the SS1 pin for SPI, A5, and the NRD signal used for the parallel bus. In short the hardware wasn't designed for use with external parallel memories.

The library does allow connection to some of the lower resolution LCD controllers that used index addressing and can speed up read/write times considerably in some situations.

Code is hosted up on git.
12  Using Arduino / Networking, Protocols, and Devices / YASP - command parser library based on regexp on: January 05, 2012, 12:02:07 pm
Just finished up a new command parser for any interface that uses Print::write (e.g. Serial).  The goal of the project was to have something that is simple to use to get quick debug commands up and running when starting a new project.  The project uses a LUA like pattern matching lib (similar to regexp) available here:

It's not the most efficient piece of code from a size or speed standpoint, but that isn't the intention at this point.  It's really just supposed to be easy to get running and have a flexible syntax.  Using the pattern matching lib allows for this and extraction of parameters.  So you can match input strings from a serial port like:

set foo 24

with the pattern:

 "^set foo (%d+)$"

and easily get to the '24' argument in the callback (this is called a capture).

To use it, import the lib into your project (and the regexp lib above).  Then just define a set of patterns to look for in the data and a callback that is activated when a match is found (one callback per match string).

You can get the code here:

Happy to hear from others on suggestions for improving its usefulness.
Pages: [1]