can somebody advise on linear sensor

Thread Starter

ED201

Joined Apr 21, 2018
12
I am trying to connect linear sensor. I tried Toshiba TCD1304 but because of the timings and the minimum frequency it does not want to work with slow Arduino. I have seen a lot of schematics (probably just ideas) but I do no believe anyone actually built a working circuit.

Although I managed to get the timing right to see the output on oscilloscope working, but Arduino is too slow to drive it and collect data at the same time.

Array of 1000 - 2000 pixels would do if I can get it working with Arduino, I am considering Arduino Due which has clock 82 Mhz
 

dendad

Joined Feb 20, 2016
4,637
I notice you already have this question running in another post.
Still, one option is you may need to go to an FPGA board. Some of those are pretty cheap now.
 

Thread Starter

ED201

Joined Apr 21, 2018
12
I asked in another post about TCD1304, it cannot be done in simple way.

this is why I am looking for a new sensor I can connect
 

BobaMosfet

Joined Jul 1, 2009
2,211
It might be more useful if you share some of your arduino code- it might be your code. The TCD1304 only needs a 4MHz max clock, and it's data rate is 1MHz. That 1us pulse rate, max. If the Arduino really can't manage this, then you should explore actual micro-controllers as a better solution.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Found this stack exchange answer in a quick Google search. Sounds promising, but I have no personal experience, so can't vouch for it:

https://arduino.stackexchange.com/questions/49387/connecting-tcd1304-with-arduino

The TCD1304's minimum OS-datarate is 200 kHz. Quite a lot more than what the arduino is capable of. You should look to faster processors or to a different sensor. The TSL1401 seems to be popular with the arduino-community.

If you /need/ the TCD1304, then an arduino due will probably be able to do it, but I'm guessing you'll have to drop the arduino-IDE to achieve the full speed of the ADC.

Here's how I've done it with a STM32F4 processor: https://tcd1304.wordpress.com/
 

Thread Starter

ED201

Joined Apr 21, 2018
12
There is nothing wrong with code I wrote for Arduino, it is just too slow

I am looking now at

NUCLEO-F446RE

it runs at 180 MHz and it has fast ADC which should do the job

The problem is starting from scratch to get the TLT touch screen etc.

it say it has support for Arduino, I am not sure what it means, can I load the same code and have it working right away ?
 
There is nothing wrong with code I wrote for Arduino, it is just too slow

I am looking now at

NUCLEO-F446RE

it runs at 180 MHz and it has fast ADC which should do the job

The problem is starting from scratch to get the TLT touch screen etc.

it say it has support for Arduino, I am not sure what it means, can I load the same code and have it working right away ?
Did you look at the Teensy2 TCD1304 application that I posted in response to your first thread on this topic? https://github.com/superzerg/TCD1304AP_teensy2pp

Also, it looks like a Teensy31 would also work https://forum.pjrc.com/threads/2858...1-to-interface-drive-a-linear-CCD-(TCD1304AP). These boards have similarities with many Arduino boards and allow you to use the Arduino IDE.
 

Thread Starter

ED201

Joined Apr 21, 2018
12
Thanks for the reply, I checked Teensy2, it has 48 Mhz clock and probably it could run TCD1304 but I couldn't find how fast I can have the analog inputs to run.

The other problem I cannot plug the touch TLT screen like arduino. I am getting one and see what I can do. Maybe it could work as an interface to store data from sensor.

I have seen the project but it looks like somebody is testing some idea, I do not know if he had it actually working.
 
A faster clock alone is not going to get you a working TCD1304-system.

It's easy to get the driving pulses for the CCD working, but digitizing the output is different matter. The data from the CCD is not going to wait for your ADC. You will need to know exactly when pixel-x is coming, how long it stays before pixel-y replaces it, and convert. All in 5µs or less (that is how long you have with the min. MClk of 800 kHz of the CCD), and if you do it too quickly, you'll read the same pixels twice, which is also no good.

About the nucleo F466: it's certainly fast enough, but starting from scratch with ARM when you're used to Arduino is going to take time. The "arduino compatible" refers only to the connectors on the board.

Here's my suggestion:
If you already have a working Arduino TLT setup, then keep that, and buy a nucleo F401re and use that for driving the TCD1304. I have a firmware which takes care of all the time-critical stuff, so you save yourself the time and pain to setup timers, adc, dma and usart controllers.

Download the SPI or UART firmware from here:
https://tcd1304.wordpress.com/downloads/
(I don't know arduino, but most microcontrollers speak UART right).

Use the arduino to drive the screen and send commands to the nucleo and collect the data from it. I have a short description of how to communicate with the nucleo here:
https://tcd1304.wordpress.com/the-firmware/
 

Thread Starter

ED201

Joined Apr 21, 2018
12
I think I saw your links before when I was looking for some ideas. I just bought one nucleo and I will play with it.

There is something you can upload and work on Nucleo from Arduino IDE, maybe I can plug the same TLT screen and load the same software.

there are so much information about Arduino it is very easy to setup something, with Nucleo I do not know where to start.
 
I have no idea. My immediate guess would be no, you cannot use the arduino IDE for the STM32 mcu's. I'm almost certain the source code for my firmware is incompatible with arduino. You will need the standard peripherals library from ST Micro. It's relatively straight-forward if you follow these steps:
https://tcd1304.wordpress.com/environment-setup/

But you don't have to compile it yourself (in fact I discourage it, unless you need to make modifications), there are precompiled binaries in all the zips in the download-section, and they work straight out-of-the-box.

You don't mention which nucleo you've purchased. The firmware is written for the STM32F401RE. To make it work on other mcus you'll need to pay attention to clocks and still there will probably be some porting to do..
 

Thread Starter

ED201

Joined Apr 21, 2018
12
I ordered Nucleo-F446RE

there is a plugin / driver to get it working on Arduino IDE, according to this page

http://www.instructables.com/id/Quick-Start-to-STM-Nucleo-on-Arduino-IDE/

this what I want to try first. it would be nice if I could fire up right away the Arduino TFT touch screen. The sensor should be easy part.

I do not mind to work on new Nucleo IDE if I have to, I have no idea what TFT to use and how to get it working. It is starting from scratch.
 
Top