DSPRelated.com
Forums

Re: using McBSP az I/o

Started by Mike Dunn December 14, 2005
Please see comments...

--- daryoosh goal <ahmadagha23@ahma...> wrote:

> hi
> I have written the following program for dsk6711 to
> use McBSP1 as I/O; but when I debug the program by
> putting a break point at the end or middle of the
> for loop,the content of input buffers (like FSRP)
> don't change although I change the logical level of
> the corresponding input pins.

Are you sure that the "the corresponding input pins"
that you are changing are correct??

>In other word the
> program read input pins only once in my program.
> Why?

My best guess is that you are probing the wrong pins
or your code is broken.
Suggestion:
Write a loop [infinite] to read 3 dip switches and
display the results on the three LEDs. Verify by
flipping the swiches.
Then, change the input to 3 McBSP pins. You will know
where to concentrate your debug. >
> Also where can I find more information about
> DB_CTL0/1 on dsk6711 and the HDL code of its
> PAL22v10?
You can get this info from the 6711 DSK help in CCS.
It gives the code for the PAL and much more.

FYI, I have not looked at your code but I have posted
it in case someone else may have the time.

mikedunn
>
> Please help me.
> thanks > my program is:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <csl_timer.h>
>
/*----*/
> /* DSP/BIOS includes */
>
/*----*/
>
>
/*----*/
> //extern far LOG_Obj LogMain;
> #include <std.h>
> #include <log.h>
> #include <swi.h>
> #include <sem.h>
> #include <clk.h
/*----*/
> /* CSL includes */
>
/*----*/
>
> #include <csl.h>
> #include <csl_irq.h>
> #include <csl_dat.h>
> #include <csl_cache.h>
> #include <csl_mcbsp.h
/*----*/
> /* Application includes */
>
/*----*/
>
> #include "vcap.h"
> #include "vdis.h"
> #include "img_proc.h" > #pragma DATA_SECTION(ext_mem,".image:ext_sect");
> #pragma
> DATA_SECTION(int_mem,".chip_image:int_sect");
> #pragma DATA_ALIGN(ext_mem,8);
> #pragma DATA_ALIGN(int_mem, 8);
>
> unsigned char ext_mem[2*576 * 769];
> unsigned char int_mem[64000];
> static MCBSP_Config ConfigLoopback = {
> 0x000,
> 0x000,
> 0x00000,
> 0x33fc05ff,
> 0x0,
> 0x0,
> 0x0,
> 0x1000
> };
>
> void main()
> {
> MCBSP_Handle hMcbsp;
> TIMER_Handle hTimer;
> volatile Uint32 x,y;
> Uint32 PinMask;
> int success = 1;
> CACHE_flush(CACHE_L2ALL,0,0);
> CSL_init();
>
> /* Let's open up serial port 1 */
> hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET);
>
> MCBSP_config(hMcbsp,&ConfigLoopback);
>
> MCBSP_start(hMcbsp,MCBSP_RCV_START |
> MCBSP_XMIT_START | MCBSP_SRGR_START|
> MCBSP_SRGR_FRAMESYNC, MCBSP_SRGR_DEFAULT_DELAY);
>
> /* Now we'll write our program.*/
>
> y=0;
> for (x=0;x<10000;x++){
> PinMask = MCBSP_getPins(hMcbsp); > if (PinMask & MCBSP_PIN_CLKR)
> {
> y=y+1;
> }
>
> }
> PinMask = MCBSP_getPins(hMcbsp);
> /* All done now, close the port. */
> MCBSP_close(hMcbsp); > }
/*----*/
>
>
/******************************************************************************\
> * End of main.c
>
\******************************************************************************/
>
>
> ---------------------------------
> Yahoo! Shopping
> Find Great Deals on Holiday Gifts at Yahoo!
> Shopping