刚买的DSP开发板(TMDSLCDK6748),运行板上自带的facedetect demo,监控器画面老是跳动,换了监控器和摄像头,问题依旧,什么原因?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
刚买的DSP开发板(TMDSLCDK6748),运行板上自带的facedetect demo,监控器画面老是跳动,换了监控器和摄像头,问题依旧,什么原因?
是否按照下面的要求做了?
to run the face detect demo, external hardware is needed, 后面这两个 "composite display", "composite camera" 是什么意思,跟一般电脑显示器,摄像头有何区别?我再强调一下, 是连DSP板的VGA口的监控器画面老跳动。而连USB口的电脑显示器正常。
你看的"composite display"是EVM板上的,你用的是LCDK,是下面的配置。
你好:
你们有没有TMDSLCDK6748的手册,另外,我是从www.mouser.com买的板子,他们说必须要TI公司对板子开具鉴定,才能换板子
从哪里下载TMDSLCDK6748的手册,
我是从www.mouser.com买的板子,他们说必须要TI公司对板子开具鉴定,才能换板子
facedetect demo 的源程序好多函数看不懂,这些函数在哪里能够查找到解析, 如在facedetect_lcdk.c 中的
RasterDMAFBConfig函数
/* Configuring the base ceiling */
RasterDMAFBConfig(SOC_LCDC_0_REGS, (unsigned int) Rgb_buffer2,
(unsigned int) (Rgb_buffer2 + DISPLAY_IMAGE_WIDTH * DISPLAY_IMAGE_HEIGHT + 15), 0);
RasterDMAFBConfig(SOC_LCDC_0_REGS, (unsigned int) Rgb_buffer2,
(unsigned int) (Rgb_buffer2 + DISPLAY_IMAGE_WIDTH * DISPLAY_IMAGE_HEIGHT + 15), 1);
base ceiling是啥意思,
PSCModuleControl函数
/* Power on VPIF */
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_VPIF, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
I2CPinMuxSetup函数
/* Initialize I2C and program UI GPIO expander, TVP5147, and ADV7343 via I2C */
I2CPinMuxSetup(0);
http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spruh79a&fileType=pdf
上面这个链接为空,TMS320C6748的PSC 寄存器的详细说明在哪 呢?
你好,
我现在用C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\lcdkC6748\spi\spi.c
来做TMS320C6748与MAX4896通讯,spi.c修改如下:
原来的 修改后的
SOC_SPI_1_REGS SOC_SPI_0_REGS
SYS_INT_SPI1_INT SYS_INT_SPI0_INT
HW_PSC_SPI1 HW_PSC_SPI0
cs = 0x04; cs = 0x10;
dcs = 0x04; dcs = 0x10 // cs用SPI0_SCSn_4
下面是修改后的:
SPIDat1Config(SOC_SPI_0_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), 0x10);
SIMO_SOMI_CLK_CS = 0x00000F10
SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);
但spi中断没有触发,不知什么原因? 想问一下:触发spi中断需要什么条件?
软件我使用CCS7.0
你好!
我想用TMS320C6748(开发板是TMDSLCDK6748) 的SPI0接口与MAX4896的SPI接口通信,
下面是我修改C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\lcdkC6748\spi\spi.c后的程序,现象是SPI中断没有触发,不知什么原因。请您指点一下。cs用SPI0_SCSn_4
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <string.h>
#include "soc_C6748.h"
#include "hw_psc_C6748.h"
#include "lcdkC6748.h"
#include "uart.h"
#include "spi.h"
#include "psc.h"
#include "interrupt.h"
#include "uartStdio.h"
#define SIMO_SOMI_CLK_CS 0x00000F10
#define CHAR_LENGTH 0x8
/******************************************************************************
** INTERNAL FUNCTION PROTOTYPES
*******************************************************************************/
static void SPIConfigDataFmtReg(unsigned int dataFormat);
static void SpiTransfer(void);
static void SetUpInt(void);
static void SetUpSPI(void);
//static void GetStatusCommand(void);
static void SendCommand(void);
void SPIIsr(void);
/******************************************************************************
** INTERNAL VARIABLE DEFINITIONS
*******************************************************************************/
volatile unsigned int flag = 1;
unsigned int tx_len;
unsigned int rx_len;
unsigned char vrf_data[260];
unsigned char tx_data[260];
volatile unsigned char rx_data[260];
unsigned char *p_tx;
volatile unsigned char *p_rx;
volatile unsigned char StatusResponseMessage[16];
/*
* ======== taskFxn ========
*/
Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");
Task_sleep(10);
System_printf("exit taskFxn()\n");
}
/*
* ======== main ========
*/
Int main()
{
/*
* use ROV->SysMin to view the characters in the circular buffer
*/
System_printf("enter main()\n");
PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_SPI0, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
/* Initializing the UART instance for serial communication. */
UARTStdioInit();
UARTPuts("Welcome to StarterWare SPI application.\r\n\r\n", -1);
UARTPuts("Here the SPI controller on the SoC communicates with", -1);
UARTPuts(" the Fingerprint Sensor present on the LCDK.\r\n\r\n", -1);
SPIPinMuxSetup(0);
SPI0CSPinMuxSetup(4);
/* Enable use of SPI1 interrupts. */
SetUpInt();
SetUpSPI();
SendCommand;
BIOS_start(); /* does not return */
return(0);
}
static void SetUpInt(void)
{
// Setup the ARM or DSP interrupt controller
#ifdef _TMS320C6X
// Initialize the DSP interrupt controller
IntDSPINTCInit();
// Register the ISR in the vector table
IntRegister(C674X_MASK_INT4, SPIIsr);
// Map system interrupt to the DSP maskable interrupt
IntEventMap(C674X_MASK_INT4, SYS_INT_SPI0_INT);
// Enable the DSP maskable interrupt
IntEnable(C674X_MASK_INT4);
// Enable DSP interrupts globally
IntGlobalEnable();
#else
/* Initialize the ARM Interrupt Controller.*/
IntAINTCInit();
/* Register the ISR in the Interrupt Vector Table.*/
IntRegister(SYS_INT_SPINT1, SPIIsr);
/* Set the channnel number 2 of AINTC for system interrupt 56.
* Channel 2 is mapped to IRQ interrupt of ARM9.
*/
IntChannelSet(SYS_INT_SPINT1, 2);
/* Enable the System Interrupts for AINTC.*/
IntSystemEnable(SYS_INT_SPINT1);
/* Enable IRQ in CPSR.*/
IntMasterIRQEnable();
/* Enable the interrupts in GER of AINTC.*/
IntGlobalEnable();
/* Enable the interrupts in HIER of AINTC.*/
IntIRQEnable();
#endif
}
void SPIIsr(void)
{
unsigned int intCode = 0;
#ifdef _TMS320C6X
IntEventClear(SYS_INT_SPI0_INT);
#else
IntSystemStatusClear(56);
#endif
intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);
while (intCode)
{
if(intCode == SPI_TX_BUF_EMPTY)
{
tx_len--;
SPITransmitData1(SOC_SPI_0_REGS, *p_tx);
p_tx++;
if (!tx_len)
{
SPIIntDisable(SOC_SPI_0_REGS, SPI_TRANSMIT_INT);
break;
}
}
if(intCode == SPI_RECV_FULL)
{
rx_len--;
*p_rx = (char)SPIDataReceive(SOC_SPI_0_REGS);
p_rx++;
if (!rx_len)
{
flag = 0;
SPIIntDisable(SOC_SPI_0_REGS, SPI_RECV_INT);
}
}
intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);
}
}
static void SetUpSPI(void)
{
unsigned char cs = 0x10;
unsigned char dcs = 0x10;
unsigned int val = SIMO_SOMI_CLK_CS;
SPIReset(SOC_SPI_0_REGS);
SPIOutOfReset(SOC_SPI_0_REGS);
SPIModeConfigure(SOC_SPI_0_REGS, SPI_MASTER_MODE);
//SPIClkConfigure(SOC_SPI_1_REGS, 150000000, 20000000, SPI_DATA_FORMAT0);
SPIClkConfigure(SOC_SPI_0_REGS, 150000000, 1000000, SPI_DATA_FORMAT0);
SPIPinControl(SOC_SPI_0_REGS, 0, 0, &val);
SPIDefaultCSSet(SOC_SPI_0_REGS, dcs);
/* Configures SPI Data Format Register */
SPIConfigDataFmtReg(SPI_DATA_FORMAT0);
/* Selects the SPI Data format register to used and Sets CSHOLD
* to assert CS pin(line)
*/
SPIDat1Config(SOC_SPI_0_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), cs);
/* map interrupts to interrupt line INT1 */
SPIIntLevelSet(SOC_SPI_0_REGS, SPI_RECV_INTLVL | SPI_TRANSMIT_INTLVL);
/* Enable SPI communication */
SPIEnable(SOC_SPI_0_REGS);
}
/*
** Configures Data Format register of SPI
**
*/
static void SPIConfigDataFmtReg(unsigned int dataFormat)
{
/* Configures the polarity and phase of SPI clock */
SPIConfigClkFormat(SOC_SPI_0_REGS,
(SPI_CLK_POL_HIGH | SPI_CLK_INPHASE),
dataFormat);
//SPIConfigClkFormat(SOC_SPI_0_REGS,
// (SPI_CLK_POL_LOW | SPI_CLK_INPHASE),
// dataFormat);
/* Configures SPI to transmit MSB bit First during data transfer */
SPIShiftMsbFirst(SOC_SPI_0_REGS, dataFormat);
/* Sets the Charcter length */
SPICharLengthSet(SOC_SPI_0_REGS, CHAR_LENGTH, dataFormat);
}
static void SendCommand(void)
{
// Issue Reset Command
tx_data[0] = 0x10;
tx_data[1] = 0x10;
tx_data[2] = 0x10;
tx_data[3] = 0x10;
tx_data[4] = 0x08;
tx_data[5] = 0x08;
tx_data[6] = 0x08;
tx_len = 7;
rx_len = 7;
SPIDat1Config(SOC_SPI_0_REGS, (SPI_CSHOLD | SPI_DATA_FORMAT0), 0x10);
SpiTransfer();
}
static void SpiTransfer(void)
{
//unsigned int intCode = 0;
p_tx = &tx_data[0];
p_rx = &rx_data[0];
SPIIntEnable(SOC_SPI_0_REGS, (SPI_RECV_INT | SPI_TRANSMIT_INT));
//while(flag);
flag = 1;
/*
intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);
while (intCode)
{
// if(intCode == SPI_TX_BUF_EMPTY)
// {
tx_len--;
SPITransmitData1(SOC_SPI_0_REGS, *p_tx);
p_tx++;
if (!tx_len)
{
SPIIntDisable(SOC_SPI_0_REGS, SPI_TRANSMIT_INT);
break;
}
// }
}
*/
/* Deasserts the CS pin(line) */
SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);
}
你好,
现在我想知道 spi0 module clock 的频率, 但SPI0 module clock (PLL0.SYSCLK2) is fixed ratio to SYSCLK1/2,
Table 6-5. Maximum Internal Clock Frequencies at Each Voltage Operating Point
CLOCK SOURCE |
CLOCK DOMAIN | 1.3V NOM | 1.2V NOM | 1.1V NOM | 1.0V NOM |
PLL0_SYSCLK1 | DSP subsystem | 456 MHz | 375 MHz | 200 MHz | 100 MHz |
SYSCLK2 clock domain peripherals and optional clock | source for ASYNC3 clock domain peripherals | 228 MHz | 187.5 MHz | 100 MHz | 50 MHz |
所以我现在想知道 CPU的电压操作点,如何知道CPU的电压操作点,我用的板是TMDSLCDK6748
你好
我想用TMS320C6748(开发板是TMDSLCDK6748) 的SPI0接口与MAX4896的SPI接口通信,
下面是我修改C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\examples\lcdkC6748\spi\spi.c,
现在现象是SPI0_CLK, SPI0_MOSI都没有信号,不知什么原因。但SPI0中断可以触发 cs用的是SPI0_SCSn_4
#define SIMO_SOMI_CLK_CS 0x00000E10
#define CHAR_LENGTH 0x8
static void SPIConfigDataFmtReg(unsigned int dataFormat);
static void SpiTransfer(void);
static void SetUpInt(void);
static void SetUpSPI(void);
void SPIIsr(UArg arg);
main()
{
PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_SPI0, PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
//Initializing the UART instance for serial communication. //
UARTStdioInit();
UARTPuts("Welcome to StarterWare SPI application.\r\n\r\n", -1);
UARTPuts("Here the SPI controller on the SoC communicates with", -1);
UARTPuts(" the Fingerprint Sensor present on the LCDK.\r\n\r\n", -1);
//This function selects the SPI0 pins for use. The SPI0 pins
// are multiplexed with pins of other peripherals in the
// System on Chip(SoC).
SPIPinMuxSetup(0);
//This function selects the specified Chip Select(CS) pin of
// SPI0 for use.
SPI0CSPinMuxSetup(4);
// Enable use of SPI1 interrupts. //
SetUpSPI();
Hwi_Params_init(¶ms);
params.eventId = 37;
params.enableInt = FALSE;
Error_init(&eb);
Hwi3 = Hwi_create(4, &SPIIsr, ¶ms, &eb);
if (Hwi3 == NULL)
{
System_printf("Hwi_create() failed for SPI!\n");
BIOS_exit(0);
}
Hwi_enable();
Hwi_enableInterrupt(4);
while(1)
SendCommand();
}
static void SendCommand(void)
{
// Issue Reset Command
tx_data[0] = 0x10;
tx_data[1] = 0x10;
tx_data[2] = 0x10;
tx_data[3] = 0x10;
tx_data[4] = 0x10;
tx_data[5] = 0x10;
tx_data[6] = 0x10;
tx_len = 7;
rx_len = 7;
SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10); //select dataformat0, 0x10 is SPIx_SCS[4] ?????? what is dataformat0 and CSDEF field
//The CSDEF field defines the state of the the SPIx_SCS[n] pins when no transmissions are performed.
//The CSNR field defines the state of the SPIx_SCS[n] pins during a master data transfer.
SpiTransfer();
}
static void SetUpSPI(void)
{
unsigned char cs = 0x10;
unsigned char dcs = 0x10;
unsigned int val = SIMO_SOMI_CLK_CS;
SPIReset(SOC_SPI_0_REGS);
SPIOutOfReset(SOC_SPI_0_REGS);
SPIModeConfigure(SOC_SPI_0_REGS, SPI_MASTER_MODE);
SPIClkConfigure(SOC_SPI_0_REGS, 150000000, 1000000, SPI_DATA_FORMAT0); //? set the prescale of clock = 150000000/1000000 - 1
SPIPinControl(SOC_SPI_0_REGS, 0, 0, &val);
SPIDefaultCSSet(SOC_SPI_0_REGS, dcs);
/* Configures SPI Data Format Register */
SPIConfigDataFmtReg(SPI_DATA_FORMAT0);
/* Selects the SPI Data format register to used and Sets CSHOLD
* to assert CS pin(line)
*/
SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, cs);
/* map interrupts to interrupt line INT1 */
SPIIntLevelSet(SOC_SPI_0_REGS, SPI_RECV_INTLVL | SPI_TRANSMIT_INTLVL);
/* Enable SPI communication */
SPIEnable(SOC_SPI_0_REGS);
}
/*
** Configures Data Format register of SPI
**
*/
static void SPIConfigDataFmtReg(unsigned int dataFormat)
{
/* Configures the polarity and phase of SPI clock */
SPIConfigClkFormat(SOC_SPI_0_REGS,
(SPI_CLK_POL_LOW | SPI_CLK_INPHASE), //?PHASE
dataFormat);
/* Configures SPI to transmit MSB bit First during data transfer */
SPIShiftMsbFirst(SOC_SPI_0_REGS, dataFormat);
/* Sets the Charcter length */
SPICharLengthSet(SOC_SPI_0_REGS, CHAR_LENGTH, dataFormat);
}
/*
** Enables SPI Transmit and Receive interrupt.
** Deasserts Chip Select line.
*/
static void SpiTransfer(void)
{
p_tx = &tx_data[0];
p_rx = &rx_data[0];
SPIIntEnable(SOC_SPI_0_REGS, (SPI_RECV_INT | SPI_TRANSMIT_INT));
while(flag);
flag = 1;
/* Deasserts the CS pin(line) */
SPIDat1Config(SOC_SPI_0_REGS, SPI_DATA_FORMAT0, 0x10);
}
/*
** Data transmission and receiption SPIIsr
**
*/
void SPIIsr(UArg arg)
{
unsigned int intCode = 0;
#ifdef _TMS320C6X
IntEventClear(SYS_INT_SPI0_INT);
#else
IntSystemStatusClear(56);
#endif
intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);
while (intCode)
{
if(intCode == SPI_TX_BUF_EMPTY)
{
tx_len--;
//SPITransmitData1(SOC_SPI_1_REGS, *p_tx);
SPITransmitData1(SOC_SPI_0_REGS, *p_tx);
p_tx++;
if (!tx_len)
{
SPIIntDisable(SOC_SPI_0_REGS, SPI_TRANSMIT_INT);
}
}
if(intCode == SPI_RECV_FULL)
{
rx_len--;
*p_rx = (char)SPIDataReceive(SOC_SPI_0_REGS);
p_rx++;
if (!rx_len)
{
flag = 0;
SPIIntDisable(SOC_SPI_0_REGS, SPI_RECV_INT);
}
}
intCode = SPIInterruptVectorGet(SOC_SPI_0_REGS);
}
}
你好,
我想问一下,因为开发板TMDSLCDK6748 的SPI0接口线与其他设备接口线共用,如EPWM0,MII , LAN8710A-EZK, 如要使用SPI0,
除了一开始要
PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_SPI0, PSC_POWERDOMAIN_ALWAYS_ON,PSC_MDCTL_NEXT_ENABLE);
//This function selects the SPI0 pins for use. The SPI0 pins
// are multiplexed with pins of other peripherals in the
// System on Chip(SoC).
SPIPinMuxSetup(0);
//This function selects the specified Chip Select(CS) pin of
// SPI0 for use.
SPI0CSPinMuxSetup(4);
还要执行哪些步骤?