Show Posts
Pages: 1 ... 6 7 [8] 9 10
106  Products / Arduino Due / Re: Composite Video Generating on: April 03, 2013, 09:56:05 am
Yes really impressiv work.
Thanks! It will even become better when I change the resistors of my R2R ladder. They're a bit too high, so that's why the pictures are a bit dark. Here is another picture:
107  Products / Arduino Due / Re: Composite Video Generating on: April 03, 2013, 08:44:10 am
Colors:
108  Products / Arduino Due / Re: Composite Video Generating on: April 03, 2013, 08:18:30 am
I got the colors almost perfect now.   smiley-mr-green
The Arduino logo, the SNES logo, and an Itembox of mkdd:
109  Products / Arduino Due / Re: Composite Video Generating on: April 03, 2013, 07:15:39 am
Arduino logo:
110  Products / Arduino Due / Re: Composite Video Generating on: April 03, 2013, 03:42:37 am
Light blue (#00c0c0):
111  Products / Arduino Due / Re: Composite Video Generating on: April 02, 2013, 09:44:21 am
This is much better already. (Same picture as above):
112  Products / Arduino Due / Re: Timer Library for Arduino DUE on: April 01, 2013, 01:40:21 pm
Well done!
113  Products / Arduino Due / Re: TVout library for Arduino Due on: March 31, 2013, 03:06:41 am
Hi there

Has someone made a TVOut library for the Arduino Due yet? If so, is it possible to post a link?

Thanks in advance
If you had looked better, you had seen that I am working on something like that: http://arduino.cc/forum/index.php/topic,153096.0.html
114  Products / Arduino Due / Re: Composite Video Generating on: March 30, 2013, 06:39:27 am
Some progress on coloring is made, but I can't get those colors to be smooth.
On the picture you can see from top to bottom Red, Green and Blue. (The green is the most bad one. But you can see some green spots)
115  Products / Arduino Due / Re: Composite Video Generating on: March 29, 2013, 10:06:58 am
The last few days, I worked on writing a wss. It was not easy, but now widescreen is possible. I have also made some progress on the color stuff. But not on the arduino yet. I first made an application on the pc to generate composite video signals from pictures. It works great. (I got another tool to get it colored again) I will work soon on color for the arduino.
116  Products / Arduino Due / Re: Composite Video Generating on: March 21, 2013, 09:04:27 am
This is just the DMA section of the code:
Code:
// Continuous DMA -> SMC port (pins 34-41)
// by stimmer

// set up 2 DMA buffers and a linked list
// 888 and 222 is NTSC timings (~15750 buffers/sec)
uint8_t dmabuf[2][888];
uint32_t dmall[10]={(uint32_t)dmabuf[0],0x60000000,0x22060000+222,0x20000000,(uint32_t)(dmall+5),
                    (uint32_t)dmabuf[1],0x60000000,0x22060000+222,0x20000000,(uint32_t)dmall};
int cbuf=0; // current buffer index

void  DMAC_Handler()
{
    uint32_t dummy=REG_DMAC_EBCISR; // clear DMA interrupt flag
    dmall[2+5*cbuf]=0x22060000+222; // may not be needed

  // write to dmabuf[cbuf] here  
  // you only have 6 clock cycles per byte!  
  // write words and longs where you can for speed
  
    cbuf=1-cbuf;
}

void setup() {
  
  // set up memory controller
  REG_PMC_PCER0= 1<<9;
  REG_SMC_SETUP0=0;  
  REG_PIOC_PDR=0b1111111100;
  REG_PIOC_ABSR&=~0b1111111100;  
  REG_SMC_WPCR=0x534d4300;
  REG_SMC_SETUP0=0x00000000;
  REG_SMC_PULSE0=0X00000101;
  REG_SMC_CYCLE0=0X00000006; // this sets the DMA rate -  84/6=14 MByte/sec
  REG_SMC_TIMINGS0=0;
  REG_SMC_MODE0=0x00000000;
  
  // this code puts DMA priority above CPU.
  MATRIX->MATRIX_WPMR=0x4d415400;
  for(int i=0;i<6;i++)MATRIX->MATRIX_MCFG[i]=1;
  MATRIX->MATRIX_MCFG[4]=4;
  for(int i=0;i<8;i++)MATRIX->MATRIX_SCFG[i]=0x01000008;
  MATRIX->MATRIX_SCFG[6]=0x011200ff;
  MATRIX->MATRIX_PRAS0=MATRIX->MATRIX_PRAS1=MATRIX->MATRIX_PRAS2=0x00000000;
  MATRIX->MATRIX_PRAS3=MATRIX->MATRIX_PRAS4=MATRIX->MATRIX_PRAS5=0x00000000;
  MATRIX->MATRIX_PRAS6=0x00030000;
  MATRIX->MATRIX_PRAS7=MATRIX->MATRIX_PRAS8=0x00000000;

  // set up DMA
  REG_PMC_PCER1= 1<<7;  
  REG_DMAC_WPMR=DMAC_WPMR_WPKEY(0x444d4143);
  REG_DMAC_EN=1;
  REG_DMAC_GCFG=0x00;
  REG_DMAC_CFG5=0x10702200;
  REG_DMAC_DSCR5=(uint32_t)dmall;
  REG_DMAC_EBCIER=1<<5;
  NVIC_EnableIRQ(DMAC_IRQn);
  
  // start DMA
  REG_DMAC_CHER=1<<5;

}

void loop() {
  
}
Thanks, but what if I want to transfer only one buffer at a time? (After calling  REG_DMAC_CHER=1<<5;)
117  Products / Arduino Due / Re: Composite Video Generating on: March 21, 2013, 01:17:38 am
The code needs tidying and commenting and debugging before I can share it (and before I forget how it works). I have got colour out of 3 monitors so far so it is looking good. This is using NTSC timings, I will try PAL another day. Resolution is  640x200 (or about 700x220 with overscan), but practically the Arduino won't be fast enough or have the ram to make use of all that. I may aim for a 160x200 mode.

Grayscale, colour bars and dot crawl smiley

Sorry, but I wanted to make such library. I really appreciate your help, but I want to do things myself. Could you give me the dma stuff at least?
118  Products / Arduino Due / Re: Synchronous Port Manipulation on Due on: March 20, 2013, 03:07:24 pm
If you want to clear a bit, you can do it like this:
Code:
REGISTER &= ~1<<bit;

Thanks, I will remember that, but it doesnt quite solve the problem. I still need to be able to write all values synchronously. I suppose I could clear that block on the port and then OR it with the new value, but its an extra step that would need to be performed each time and I would like to avoid it.
I don't think that's possible. The registers are 32 bit. But if you don't use the remaining pins, you can just use
Code:
REGISTER = 8bitvalue << firstbitnr;
119  Products / Arduino Due / Re: Synchronous Port Manipulation on Due on: March 20, 2013, 02:50:12 pm
Coming from this thread on port manipulation:

http://arduino.cc/forum/index.php/topic,129868.15.html

I was able to put together the following sketch:

Code:
void setup()
  {
    int k ; 
   
    for( k = 44 ; k <= 51 ; k++ )
      pinMode( k, OUTPUT ) ; // Sets Port C12-C19 to output pins. Necessary or no data is written.
 
    for( k = 34 ; k <= 41 ; k++ )
      pinMode( k, OUTPUT ) ; // Sets Port C2-C9 to output pins
 
    // Set the output pins in the Output Write Enable Register
    REG_PIOC_OWER = 0x000FF3FC ;
 
    // Disable writing to all other pins on the same port
    REG_PIOC_OWDR = 0xFFF00C03 ;
  }

void loop()
  {
    int i ;
   
// Writes data to pins 44-51 (PortC 12-19)
    for( i = 0 ; i <= 128 ; i++ )
      REG_PIOC_ODSR = i << 12 ;

// Writes data to pins 34-41 (PortC 2-9)
    for( i = 0 ; i <= 128 ; i++ )
      REG_PIOC_ODSR = i << 2 ;       
   
  }


What I can't figure out, is how to write data to a specific 8 pins without modifying all of the other pins on the port. In the sketch above, the value 128 should remain present on PortC19 until I start writing to that block again, but what actually happens is it gets set to zero as soon as I start the next loop. I realize that I could OR the port with the new value but then if the pin was already high and I need to write a 0 to it it won't change. Has anyone been able to solve this problem?
If you want to clear a bit, you can do it like this:
Code:
REGISTER &= ~1<<bit;
120  Products / Arduino Due / Re: Composite Video Generating on: March 20, 2013, 01:49:25 pm
Success!  smiley-cool smiley-mr-green smiley-lol
smiley-eek Cool! May I have your code?
Pages: 1 ... 6 7 [8] 9 10