Show Posts
Pages: [1] 2 3 ... 34
1  Products / Arduino Due / Re: VGA library - now with TV output on: May 09, 2014, 02:46:49 pm
I wasn't going to add VGA I2C support to the library itself. I guess if someone else did I could add the code as an example but it wouldn't be part of the core library.

I've not had much success with I2C on the Due - I can't get any I2C device to work! I think the VGA I2C is just an EEPROM which should be quite simple. Processing the data from the EEPROM is harder - getting the make and model strings is quite easy, getting the sync ranges and native resolution is more difficult.
2  Products / Arduino Due / Re: PROGMEM Issue I read all other PROGMEM posts on: April 07, 2014, 11:43:28 am
You are using pgm_read_word to read an address, but pgm_read_word is only 16-bits. That might work on a Mega (and even then only for 'near' addresses) but it won't work on a Due, which uses 32 bit addresses.
3  Products / Arduino Due / Re: PROGMEM Issue I read all other PROGMEM posts on: April 06, 2014, 01:12:38 pm
Thanks for the simplified example code, it really does make debugging these problems much easier.

Firstly the PROGMEM compatibility code is already in avr/pgmspace.h which is automatically included, so you don't need most of the big #if block. The problem is that there are two bugs in pgmspace.h:

1) sprintf_P only works if there are 3 or more arguments. There's not much point using sprintf with only 2 arguments (strcpy is better), however I think for consistency it should work.

2) sscanf_P isn't there at all!

To work around this, change the #if block to just contain the following:
Code:
#if defined(__SAM3X8E__)
  #define sprintf_P sprintf
  #define sscanf_P sscanf
#endif
4  Products / Arduino Due / Re: PROGMEM Issue I read all other PROGMEM posts on: April 05, 2014, 05:35:11 pm
Just spotted this:
Code:
    #define pgm_read_word_near(x)   ( ((*((unsigned char *)x + 1)) << 8) + (*((unsigned char *)x)))
    #define pgm_read_word_far(x)    ( ((*((unsigned char *)x + 1)) << 8) + (*((unsigned char *)x))))
One of these must obviously be wrong!
5  Products / Arduino Due / Re: Arduino Due DAC0 problem (not working) on: March 24, 2014, 05:18:15 pm
 Just to add to the confusion, I tried shunting the output of DAC1 through various low resistances for a few seconds whilst it was outputting a sine wave, before eventually shorting it to ground for a second. It still works! smiley-confuse

Has anyone managed to blow DAC1? All the failures I've seen have been on DAC0. I am now convinced it's a problem with the SAM3X silicon rather than anything we are doing wrong.
6  Products / Arduino Due / Re: VGA library - now with TV output on: March 10, 2014, 05:33:18 pm
Serial1 shouldn't cause a problem, it's no worse than using Serial via the programming port and that works fine.

It just sounds like the signal generated is too far out of spec for a TV that old. Those TVs use crystals in the colour circuit so the signal has to be accurate to a few ppm - newer TVs do the NTSC decoding on a FPGA/ASIC and the signal can be out by almost 1% and it still gives colour.

Unfortunately this is not something I am likely to fix. The code for the library is getting too difficult to maintain. If I did it all again I now know better ways to get a more accurate signal (and more easily maintainable code)
7  Products / Arduino Due / Re: VGA library - now with TV output on: March 10, 2014, 03:46:52 pm
Which version of the Arduino software are you using? I'm using 1.5.6r2 on Linux and it is working in colour on a fairly recent monitor (although is has to be said that the picture quality is not very good - if you know what 8-bit computer TV output used to look like in the 80s you'll know what to expect; if not, be prepared to lower your standards smiley )

Make sure you are connected via the programming port - the NTSC code clashes with the Native port causing flicker and hangs.
8  Products / Arduino Due / Re: VGA library - now with TV output on: March 10, 2014, 12:49:48 pm
The circuit for NTSC (and PAL) is on this page: http://stimmer.github.io/DueVGA/tvout.html . Getting as close as you can to the correct values of the resistors is very important.

You can extend it to 8 bits if you want - you need 6.4k on pin 35 and 12.8k on pin 34 - the reason I didn't include them is because if you're using 1% tolerance resistors they won't add significantly to the precision of the output.

The NTSC code uses all 8 bits of colour data to synthesize the NTSC signal.

The older the TV is the less chance of getting colour output. The signal generated by my code is somewhat out of spec. Modern TVs are much more tolerant of badly generated signals than old CRT sets. It's best to try and get it working on a newer TV first, then try it on the old TV. I have had it working in PAL on a colour monitor bought in 1991 and in NTSC on a colour TV from about 2003.
9  Products / Arduino Due / Re: Arduino Due - Compatibility with HDMI? on: February 26, 2014, 12:59:43 pm
HDMI output is far beyond the capability of the Due unfortunately.

I've used my VGA library on a normal-sized projector and it worked fine. I haven't got a picoprojector to try it on though. It can be used to generate VGA signals or PAL/NTSC, if the picoprojector has VGA or composite inputs it should work fine. See this thread:

http://forum.arduino.cc/index.php?topic=150517.0
10  Products / Arduino Due / Re: analogWrite freezes the board on: February 19, 2014, 04:16:14 pm
Firstly, delete/uninstall the Arduino IDE, re-download it and reinstall it.

Then try running the Basics->Fade example with an LED+resistor connected to pin 9 and GND. Does it work?
11  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: February 15, 2014, 10:54:38 pm
I worded it confusingly - what I meant was NRD is unusable, not A5. With them both wired to the same Due pin it's either one or the other. But NRD is not needed for a RAM.

My test program writes all 128K sequentially with a pseudorandom sequence then reads it all back checking every value - no errors smiley
12  Products / Arduino Due / Re: Parallel library for Due External Memory Bus/Static Memory Controller on: February 15, 2014, 08:19:32 pm
I just bought a DigiX (a Due clone, see https://www.kickstarter.com/projects/digistump/digix-the-ultimate-arduino-compatible-board-with-w and http://digistump.com/wiki/digix ). The DigiX has the four missing address and data pins (among others) on another row of connectors to the right of the board. Unfortunately, for compatibility with the Due the NRD signal is still wired to A5 so is unusable - although as I pointed out before you don't usually need it.

I wired up my 128Kx8bit ram up to the DigiX, and can confirm that the library works correctly with no modification needed, and no address gaps smiley I haven't tried a 16 bit data bus yet as I haven't got a 16 bit ram, but I can't think of any reason why it wouldn't work.
13  Products / Arduino Due / Re: Arduino Due - route internal clock to PCKx on: February 15, 2014, 02:05:30 pm
What you need to do is to set the PIO registers to allow peripherla control of the pin. Use PIOA->PIO_PDR= to disable PIO and enable peripheral control for the relevant pin, and then set PIOA->PIO_ABSR |= or &=~ correctly to pick the right peripheral. Read the datasheet section 11 to find if it's peripheral A or B, then section 32 for the PIO registers.
14  Products / Arduino Due / Re: Arduino Due - route internal clock to PCKx on: February 15, 2014, 12:51:39 pm
Code:
  REG_PMC_WPMR = 0x504D4301;     

I think you have this the wrong way round - 0x504D4301 enables write protection (and disables being able to write to the registers), 0x504D4300 disables write protection (enables writing the registers)
15  Products / Arduino Due / Re: Due Flash Memory on: February 08, 2014, 04:00:36 pm
Do you mean like including a binary file into a sketch? I've done it on Linux using inline assembler, I don't know if the same trick will work on Windows or Mac though.

Code:
extern char binfile[];
 asm(   "\n.section .text\n.globl binfile \n binfile : \n.incbin \"/home/user/full/path/to/sketch/file.bin\" \n");

void setup() {
  Serial.begin(115200);
  char tmp[1000];
  for(int i=0;i<999;i++)tmp[i]=*(binfile+i);
  tmp[999]=0;
  Serial.println(tmp);
  Serial.println((long)binfile,HEX);
}

void loop() {
}
Pages: [1] 2 3 ... 34