UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor kanber_kav
Visitor
428 Views
Registered: ‎10-16-2019

How to connect Spartan 3E starter board TSL1412S linear array sensor?

Jump to solution

https://www.digikey.com/product-detail/en/ams/TSL1412S/TSL1412-S-ND/3095067

How to connect Spartan 3E starter board TLS1412S linear array sensor?

How can we read from the ADC port?
Does anyone have an idea?
Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
Teacher drjohnsmith
Teacher
342 Views
Registered: ‎07-09-2009

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution

Thats now the digilent board,

They have some great docs and a support forum

https://reference.digilentinc.com/_media/s3e:s3estarter_ug.pdf

https://reference.digilentinc.com/_media/s3e:spartan-3e_sch.pdf

https://forum.digilentinc.com/

 

I'd suggest you start with the referance design for the board, found here

https://reference.digilentinc.com/reference/programmable-logic/spartan-3e/start?redirect=1

 

That will give you an idea of the many inerfaces this board has, 

    As a clue, the 6 PMOD connectors might be of interest,  but you will find out about them in detail fomr the reference designs, build them and then you will be able to ask a more detailed quesiton,

 

  

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>

View solution in original post

7 Replies
Teacher drjohnsmith
Teacher
408 Views
Registered: ‎07-09-2009

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution
Try searching for the manuals and ref docs for the boards,
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Visitor kanber_kav
Visitor
385 Views
Registered: ‎10-16-2019

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution

I did not understand how to make a physical connection. There are analog input, clk, SI and Hold connections on TLS1412s.

There is only adc entry on Spartan 3e.

0 Kudos
Teacher drjohnsmith
Teacher
380 Views
Registered: ‎07-09-2009

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution

Which Spartan 3 board do you have ?

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Visitor kanber_kav
Visitor
374 Views
Registered: ‎10-16-2019

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution

spartan-3e-starter-10753-44-B.jpg

SPARTAN 3E STARTER

(xcs500e-4fg320)

0 Kudos
Teacher drjohnsmith
Teacher
343 Views
Registered: ‎07-09-2009

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution

Thats now the digilent board,

They have some great docs and a support forum

https://reference.digilentinc.com/_media/s3e:s3estarter_ug.pdf

https://reference.digilentinc.com/_media/s3e:spartan-3e_sch.pdf

https://forum.digilentinc.com/

 

I'd suggest you start with the referance design for the board, found here

https://reference.digilentinc.com/reference/programmable-logic/spartan-3e/start?redirect=1

 

That will give you an idea of the many inerfaces this board has, 

    As a clue, the 6 PMOD connectors might be of interest,  but you will find out about them in detail fomr the reference designs, build them and then you will be able to ask a more detailed quesiton,

 

  

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>

View solution in original post

Visitor kanber_kav
Visitor
119 Views
Registered: ‎10-16-2019

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution

Ekran Alıntısı.PNG

 

 

# Spartan-3E Starter Board
Net fpga_0_RS232_DCE_RX_pin LOC=R7 | IOSTANDARD = LVCMOS33;
Net fpga_0_RS232_DCE_TX_pin LOC=M14 | IOSTANDARD = LVCMOS33;

Net fpga_0_LEDS_GPIO_IO_O_pin<0> LOC=F9 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<1> LOC=E9 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<2> LOC=D11 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<3> LOC=C11 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<4> LOC=F11 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<5> LOC=E11 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<6> LOC=E12 | IOSTANDARD = LVCMOS33;
Net fpga_0_LEDS_GPIO_IO_O_pin<7> LOC=F12 | IOSTANDARD = LVCMOS33;

Net fpga_0_clk_1_sys_clk_pin TNM_NET = sys_clk_pin;
TIMESPEC TS_sys_clk_pin = PERIOD sys_clk_pin 50000 kHz;
Net fpga_0_clk_1_sys_clk_pin LOC=c9 | IOSTANDARD = LVCMOS33;
Net fpga_0_rst_1_sys_rst_pin TIG;
Net fpga_0_rst_1_sys_rst_pin
LOC=K17 | IOSTANDARD = LVCMOS33 | PULLDOWN;
NET button_pin LOC = L17;

NET clk_lineer_GPIO_IO_pin LOC = D7 | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 8 ;
NET si_lineer_GPIO_IO_pin LOC = C7 | IOSTANDARD = LVCMOS33 | SLEW = FAST | DRIVE = 8 ;

 

 

 

C code

 

/*
* Copyright (c) 2009-2012 Xilinx, Inc. All rights reserved.
*
* Xilinx, Inc.
* XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
* COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
* ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
* STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
* IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
* FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
* XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
* THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
* ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
* FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE.
*
*/

/*
* helloworld.c: simple test application
*
* This application configures UART 16550 to baud rate 9600.
* PS7 UART (Zynq) is not initialized by this application, since
* bootrom/bsp configures it to baud rate 115200
*
* ------------------------------------------------
* | UART TYPE BAUD RATE |
* ------------------------------------------------
* uartns550 9600
* uartlite Configurable only in HW design
* ps7_uart 115200 (configured by bootrom/bsp)
*/

#include <stdio.h>
#include "platform.h"
#include "xparameters.h"
#include "xgpio.h"
#include <string.h>
#include "xdsadc.h"

 

/************************** Constant Definitions *****************************/

/*
* The following constants map to the XPAR parameters created in the
* xparameters.h file. They are defined here such that a user can easily
* change all the needed parameters in one place.
*/
#define DSADC_DEVICE_ID XPAR_ADC_0_DEVICE_ID

#define TEST_LENGTH 256 /* Length of the Test Data */
#define FSTM_VALUE 0x04 /* Intial value of the FSTM Register */


int DsAdcPolledExample(u16 DeviceId);

/************************** Variable Definitions *****************************/

static XDsAdc DsAdc; /* Instance of the ADC Device */

u16 RxData[TEST_LENGTH]; /* Buffer for storing the converted data */
static u16 *RxDataPtr = RxData; /* Pointer to the receive buffer */
static u32 RxDataLength = 0; /* Variable for storing Rx data length */


void print(char *str);


void SamplingDelay()
{
int ii;
for( ii=0;ii<5000;ii++);

}


int DsAdcPolledExample(u16 DeviceId)
{
int Status;
u32 IsrStatus;
XDsAdc *InstancePtr = &DsAdc;


/*
* First Initialize the device.
*/
Status = XDsAdc_Initialize(InstancePtr, DeviceId);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}


/*
* Set the FSTM register to a usable value.
*/
XDsAdc_SetFstmReg(InstancePtr, FSTM_VALUE);

/*
* Enable the conversion process in the DSADC.
*/
XDsAdc_EnableConversion(InstancePtr);

/*
* Wait for the data to complete.
*/
do {
if (XDsAdc_IsEmpty(InstancePtr) != TRUE) {

*RxDataPtr++ = XDsAdc_ReadInput(InstancePtr);
RxDataLength++;

/*
* Since the bit indicating that the ADC is finished
* converting a sample in located in the IPISR, the
* clearing of the bit is just like clearing the bit in
* interrupt driven mode.
*/
IsrStatus = XDsAdc_GetInterruptStatus(InstancePtr);
XDsAdc_ClearInterruptStatus(InstancePtr, IsrStatus);
}
} while (RxDataLength <= TEST_LENGTH);
/*int i=0;
u16 dene=0;
for (i=0;i<256;i++)
{
u16 dene=0;
dene= RxDataPtr[i];

}*/

return XST_SUCCESS;
}


int main()
{
int Status;
unsigned char i;
XGpio clksensor,sisensor,leds_8bit;
u32 IsrStatus;


XGpio_Initialize(&clksensor,XPAR_CLK_LINEER_DEVICE_ID);
XGpio_Initialize(&sisensor,XPAR_SI_LINEER_DEVICE_ID);
XGpio_Initialize(&leds_8bit,XPAR_LEDS_DEVICE_ID);
XGpio_SetDataDirection(&leds_8bit,1,0x0);
XGpio_SetDataDirection(&clksensor,1,0x0);
XGpio_SetDataDirection(&sisensor,1,0x0);

 

XDsAdc *InstancePtr = &DsAdc;
Status = XDsAdc_Initialize(InstancePtr, DSADC_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
XDsAdc_SetFstmReg(InstancePtr, FSTM_VALUE);
XDsAdc_EnableConversion(InstancePtr);


while(1)
{

XGpio_DiscreteWrite(&leds_8bit,1,1);
SamplingDelay();
XGpio_DiscreteWrite(&leds_8bit,1,0);

// TSL1401_SI = 1; /* SI = 1 */
XGpio_DiscreteWrite(&sisensor,1,1);
SamplingDelay();
//TSL1401_CLK = 1; /* CLK = 1 */
XGpio_DiscreteWrite(&clksensor,1,1);
SamplingDelay();
//TSL1401_SI = 0; /* SI = 0 */
XGpio_DiscreteWrite(&sisensor,1,0);
SamplingDelay();
// TSL1401_CLK = 0; /* CLK = 0 */
XGpio_DiscreteWrite(&clksensor,1,0);

for(i=0; i<256; i++) {
SamplingDelay();
SamplingDelay();
//TSL1401_CLK = 1; /* CLK = 1 */
XGpio_DiscreteWrite(&clksensor,1,1);
SamplingDelay();
SamplingDelay();
//TSL1401_CLK = 0; /* CLK = 0 */


RxDataPtr++ = XDsAdc_ReadInput(InstancePtr);
RxDataLength++;


IsrStatus = XDsAdc_GetInterruptStatus(InstancePtr);
XDsAdc_ClearInterruptStatus(InstancePtr, IsrStatus);

XGpio_DiscreteWrite(&clksensor,1,0);
}

 


SamplingDelay();
SamplingDelay();
// TSL1401_CLK = 1; /* CLK = 1 */
XGpio_DiscreteWrite(&clksensor,1,1);
SamplingDelay();
SamplingDelay();
// TSL1401_CLK = 0; /* CLK = 0 */
XGpio_DiscreteWrite(&clksensor,1,0);

}


return 0;
}


void Delay(int delay)
{
int ii;
for( ii=0;ii<delay*10000;ii++);

}

 

 

My microblaze settings and c code are as below, but I can't receive any signals. Where am I doing wrong. thank you for your help.

 

0 Kudos
Teacher drjohnsmith
Teacher
102 Views
Registered: ‎07-09-2009

Re: How to connect Spartan 3E starter board TLS1412S linear array sensor?

Jump to solution
you need to start a new topic
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos