Loading Arduino Duemilanove

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Loading Arduino Duemilanove

Paul Venable
Hello All,

I recently purchase a Arduino Dueilanove board to receive TTL inputs within a Java program; however, I am having problem loading the device within my program.  I am able to control the board using the Arduino.exe.  Below is the code I am using:

       core.loadDevice("Arduino-Hub","Arduino","Arduino-Hub");
        core.initializeDevice("Arduino-Hub");

        core.loadDevice("Arduino-Switch","Arduino","Arduino-Switch");
        core.initializeDevice("Arduino-Switch");

And this is the error message I am recieving:

      LOG(2010-04-19T15:17:52.203125, 2508, 000B7258:): Device Arduino-Hub loaded from Arduino and labeled as Arduino-Hub
       Error code: 22
       Arduino-Hub. Error code 17 (11 hex).

       LOG(2010-04-19T15:17:54.234375, 2508, 000B7258:): Error occured. Device Arduino-Hub. Arduino-Hub. Error code 17 (11 hex).
       , file .\MMCore.cpp, line 832


I am to load the board Hub, Switch and Shutter within MicroManager's Hardware Configuration Wizard, then turn the LED on and off using the Shutter test.

Also, if anyone has any code on how to use/change the pins to read an input, that would be greatly appreciated.

Thanks,

Paul Venable


Research Assistant
Nora Eccles Harrison
Cardiovascular Research and Training Institute
University of Utah
95 South 2000 East
Salt Lake City UT 84112-5000
phone (801) 587-9530
fax (801) 581-3128
Email [hidden email]
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Loading Arduino Duemilanove

Nico Stuurman
Administrator
<base href="x-msg://24/">Hi Paul,

I recently purchase a Arduino Dueilanove board to receive TTL inputs within a Java program; however, I am having problem loading the device within my program. 

What is "your program"?  Are you linking from C/C++ to MMCore?  Are you using it from Java/Python/Matlab?  Since you have the adapter working from Micro-Manager, there is something in the environment from which you call MMCore and into the adapter that does not work just right.

I am able to control the board using the Arduino.exe. 

Do you mean that you succesfully uploaded the firmware code ( https://valelab.ucsf.edu/svn/micromanager2/branches/micromanager1.3/DeviceAdapters/Arduino/AOTFcontroller.pde ) to the Arduino?

And this is the error message I am recieving:

      LOG(2010-04-19T15:17:52.203125, 2508, 000B7258:): Device Arduino-Hub loaded from Arduino and labeled as Arduino-Hub
       Error code: 22
       Arduino-Hub. Error code 17 (11 hex). 

This is error: MMERR_InvalidLabel.  No idea why you encounter it.

I am to load the board Hub, Switch and Shutter within MicroManager's Hardware Configuration Wizard, then turn the LED on and off using the Shutter test.

Also, if anyone has any code on how to use/change the pins to read an input, that would be greatly appreciated.

The current firmware code does not read out the state of any pins.  Problem is that the standard Arduino does not have many pins left, but I think that the analogue input pins can double as digital input pins.  It should not be too hard to write the extra firmware function to do this, as well as create a device in the Arduino Micro-Manager adapter.  How many input pins do you need?

Best,

Nico



Thanks,

Paul Venable


Research Assistant
Nora Eccles Harrison
Cardiovascular Research and Training Institute
University of Utah
95 South 2000 East
Salt Lake City UT 84112-5000
phone (801) 587-9530
fax (801) 581-3128
Email [hidden email]------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Loading Arduino Duemilanove

Paul Venable
In reply to this post by Paul Venable
Hi Nico,

I am using the MMCore within a Java program I have written that already includes an Andor acquisiton process and sends a TTL pulse through the parallel port.  I would like to intergate the Arduino board into this program to recieve inputs.  I have uploaded the firmware from the device adapters page and everything works fine within MicroManager itself, ie I can complete the LED test listed on the wiki.  I only need one or two input pins.  My ultimate goal is to have the Arduino board installed on a "slave" computer that will wait  for  a TTL pulse sent to the Arduino from a "master" computer and then initialize an acquisition process.

Thanks for your help,

Paul

Research Assistant
Nora Eccles Harrison
Cardiovascular Research and Training Institute
University of Utah
95 South 2000 East
Salt Lake City UT 84112-5000
phone (801) 587-9530
fax (801) 581-3128
Email [hidden email]

From: Nico Stuurman [mailto:[hidden email]]
To: Micro-Manager General [mailto:[hidden email]]
Sent: Tue, 20 Apr 2010 10:02:24 -0600
Subject: Re: [micro-manager-general] Loading Arduino Duemilanove

Hi Paul,

I recently purchase a Arduino Dueilanove board to receive TTL inputs within a Java program; however, I am having problem loading the device within my program. 

What is "your program"?  Are you linking from C/C++ to MMCore?  Are you using it from Java/Python/Matlab?  Since you have the adapter working from Micro-Manager, there is something in the environment from which you call MMCore and into the adapter that does not work just right.

I am able to control the board using the Arduino.exe. 

Do you mean that you succesfully uploaded the firmware code ( https://valelab.ucsf.edu/svn/micromanager2/branches/micromanager1.3/DeviceAdapters/Arduino/AOTFcontroller.pde ) to the Arduino?

And this is the error message I am recieving:

      LOG(2010-04-19T15:17:52.203125, 2508, 000B7258:): Device Arduino-Hub loaded from Arduino and labeled as Arduino-Hub
       Error code: 22
       Arduino-Hub. Error code 17 (11 hex). 

This is error: MMERR_InvalidLabel.  No idea why you encounter it.

I am to load the board Hub, Switch and Shutter within MicroManager's Hardware Configuration Wizard, then turn the LED on and off using the Shutter test.

Also, if anyone has any code on how to use/change the pins to read an input, that would be greatly appreciated.

The current firmware code does not read out the state of any pins.  Problem is that the standard Arduino does not have many pins left, but I think that the analogue input pins can double as digital input pins.  It should not be too hard to write the extra firmware function to do this, as well as create a device in the Arduino Micro-Manager adapter.  How many input pins do you need?

Best,

Nico



Thanks,

Paul Venable


Research Assistant
Nora Eccles Harrison
Cardiovascular Research and Training Institute
University of Utah
95 South 2000 East
Salt Lake City UT 84112-5000
phone (801) 587-9530
fax (801) 581-3128
Email [hidden email]
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Loading Arduino Duemilanove

Nico Stuurman
Administrator
In reply to this post by Paul Venable
<base href="x-msg://26/">Hi Paul,

I though a little longer about this problem, also since Shashank reported something similar.  

I recently purchase a Arduino Dueilanove board to receive TTL inputs within a Java program; however, I am having problem loading the device within my program.  I am able to control the board using the Arduino.exe.  Below is the code I am using:

       core.loadDevice("Arduino-Hub","Arduino","Arduino-Hub");
        core.initializeDevice("Arduino-Hub");

        core.loadDevice("Arduino-Switch","Arduino","Arduino-Switch");
        core.initializeDevice("Arduino-Switch");

And this is the error message I am recieving:

      LOG(2010-04-19T15:17:52.203125, 2508, 000B7258:): Device Arduino-Hub loaded from Arduino and labeled as Arduino-Hub
       Error code: 22
       Arduino-Hub. Error code 17 (11 hex). 

Turns out that you need to set the Pre-Initialization property ("Port") before initializing the Arduino-Hub.  I get the same error your report in the Micro-Manager script panel.  However, the following works:

mmc.unloadAllDevices();
mmc.loadDevice("Arduino-Hub","Arduino","Arduino-Hub");
mmc.loadDevice("SerialPort", "SerialManager", "/dev/tty.usbserial-A4001t3L");
mmc.initializeDevice("SerialPort");
mmc.setProperty("SerialPort", "BaudRate", "57600");
mmc.initialize("Arduino-Hub");


In Shahank's case, the Shutter-A he tries to initialize likely also needs a pre-initialization property to be set.  You can get a list of the pre-initialization properties by going through the Micro-Manager hardware configuration wizard, or you can get the API calls "getDevicePropertyNames (const char *label)" and "isPropertyPreInit (const char *label, const char *propName)".

Best,

Nico

------------------------------------------------------------------------------

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general