[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RV: SSP in MASTER_BIDIR mode





O> -----Mensaje original-----
O> De: Johan.Adolfsson@xxxxxxx.com">mailto:Johan.Adolfsson@xxxxxxx.com] 
O> Enviado el: viernes, 17 de octubre de 2003 12:42
O> Para: Carlos Ojea; dev-etrax@xxxxxxx.com
O> Asunto: Re: SSP in MASTER_BIDIR mode
O> 
O> 
O> 
O> ----- Original Message ----- 
O> From: "Carlos Ojea" <carlosojea@xxxxxxx.es>
O> To: <dev-etrax@xxxxxxx.com>
O> Sent: Thursday, October 16, 2003 5:51 PM
O> Subject: SSP in MASTER_BIDIR mode
O> 
O> 
O> > 
O> > Hello:
O> > 
O> > When I configure SSP in MASTER_BIDIR mode my program runs 
O> very, very, 
O> > slowly and CLOCK_GATED does not work (master output mode works ok).
O> > 
O> > Here is part of my program:
O> > devspi = open ("/dev/syncser0", O_RDWR | O_SYNC | O_NONBLOCK);    
O> > ioctl (devspi, SSP_MODE, MASTER_BIDIR);  
O> > ioctl (devspi, SSP_FRAME_SYNC, FLOW_CONTROL_DISABLE);    
O> > ioctl (devspi, SSP_FRAME_SYNC, CLOCK_GATED);      
O> 
O> Just to be sure, try specifying all the possible options for the 
O> SSP_FRAME_SYNC in one call, e.g:
O> 
O>  tmp = NORMAL_SYNC | BIT_SYNC | SYNC_ON |
O>   WORD_SIZE_8 | BIT_ORDER_MSB | 
O>   FLOW_CONTROL_DISABLE | CLOCK_NOT_GATED;
O>  if (ioctl(fd, SSP_FRAME_SYNC, tmp)) {
O>   fprintf(stderr, "Couldn't change sync SSP_FRAME_SYNC\n");
O>   err++;
O>  }
O> 
O> and also set the other possible parameters to fit your device:
O> 
O>  tmp = CLOCK_INEGEDGE | FRAME_NORMAL | STATUS_NORMAL;
O>  if (ioctl(fd, SSP_IPOLARITY, tmp)) {
O>   fprintf(stderr, "Couldn't change polarity SSP_IPOLARITY\n");
O>   err++;
O>  }
O> 
O>  tmp = CLOCK_NORMAL | FRAME_NORMAL | STATUS_NORMAL;
O>  if (ioctl(fd, SSP_OPOLARITY, tmp)) {
O>   fprintf(stderr, "Couldn't change polarity SSP_OPOLARITY\n");
O>   err++;
O>  }
O>  /* 64 kHz, word_sync: 8 bits/sync, frame_sync: 1 (no 
O> framing) */  if (ioctl(fd, SSP_SPEED, CODEC_VAL(FREQ_64kHz, 8, 1))) {
O>   fprintf(stderr, "Couldn't change sync SSP_SPEED\n");
O>  }
O>  /* 160 bytes (160 samples = 20 ms) buffering */
O>  if (ioctl(fd, SSP_INBUFCHUNK, 160)) {
O>   fprintf(stderr, "Couldn't change sync SSP_BUFCHUNK\n");
O>   err++;
O>  }
O> 
O> I'm not sure the CLOCK_GATED option do what you desire, 
O> but feel free to try it.
O> 
O> I assume you don't have enabled DMA, is that correct?
O> 
O> 
O> 
O> > Anybody knows why or have any clue?
O> > 
O> > Regards,
O> > Carlos
O> 
O> /Johan
O>  
O>