Embedded Eye

Give your gizmo the gift of sight

One question that keeps coming up is whether you can use an Arduino Due with the Stonyman chips, especially since the ARM processor on the Due operates at 3.3V. I don't have a 'Due yet, but we have been interfacing them with ST Micro ARMs (STM32F4) and we know they work fine. There are two options:

Option 1: (Best) Power the ARM at 3.3V and the Stonyman at 4.5V to 5V. The best option is to power the Stonyman at the higher voltage to get the most range out of it. Although the ARM's I/O to the Stonyman is 0 - 3.3V, the Stonyman will interpret an input voltage of 3.3V as a digital "1". You can also directly connect the ANALOG output from the Stonyman to the ARM- the Stonyman will not output more than 3.3V, so you should not fry the ADC input. You can power the Stonyman at a slightly lower voltage, as long as it is a clean power supply.

Option 2: (Doable but sub-optimal) Power both the ARM and the Stonyman at 3.3V. If you do this, you will have to use the amplifier option of the Stonyman chip. This reduces the output voltage swing a bit, and slows the chip down, but it will still work.

I cannot say anything about how the current source code will work with a Due since we don't have a Due yet to play with.

Views: 1062

Reply to This

Replies to This Discussion

The Due has a 5v power bus, so option one shouldn't be a problem.

Does anyone know if there is an update to the library and examples coming soon for the Due? I am about to jump into code and see what I can accomplish, but I'd rather not reinvent the wheel if someone else has made significate progress in this area.

It should be pretty straight forward to make the change to the library for your use. Basically the Stonyman chip is operated by pulsing lines D4, D5, D6, D7, and D8 according to the specified sequence. The change would be made primarily to the ArduEye_SMH_v1 library. You'll see macros such as SMH1_IncP_Pulse which basically pulse the corresponding line.

The connections between the Arduino and the Stonyman are as follows:






A0 = ANALOG (analog output of chip to ADC)

If you look at the datasheet for the Stonyman, it will be pretty clear what these pins mean. (I designed this chip to be VERY easy to use!)

Awesome, thanks for the quick reply! I haven't jumped in yet, but was concerned there might be some AVR specific interrupts and what not. Glad to hear I won't have to dig too deep. When I do get around to working on this, once I get it done, is there a place I can send my work to try and help along the revisions to the library for the Due?

I just made a quick attempt to compile FirstApp on the Arduino Due. I connected the stonyman breakout board to the normal pins on the board as indicated by Geof:







I commented out all the EEPROM stuff because I could imagine that having nasty effects if wrong.

Compiling gave me  a #error because the chip name is not known so I put in #define __AVR_ATmega328P__ 1 to see how far it would get pretending to be another board.

I am getting DDRB was not declared, PORTB was not declared type errors in ArduEye_SMH.cpp. I can see that PORTB is about rapid digital pin manipulation. I imagine PORTB should be defined in the arduino environment but appears not to be in my Arduino 1.5.2 IDE.

I am going to bed now so can anyone tell me how to work around  the apparent missing PORTB, PORTC error problems while I sleep????


If it's any use the below is a link to where we were doing a similar thing with teensy3, second bottom.  Teensy 3 is an ARM working on an arduino platform, however it is NOT a due running on the arm version of arduino.  I have no idea how arduino gets round the fact that due has no ddr etc on the ardunio version on the arduino site.  confused? sorry.


Clinton- I *finally* purchased a Teensy 3.0 to play with. It looks pretty nice! -Geof

I have finals this coming week and after that I am leaning into this full boar.  You are going to have to adjust the port mapping to that of the Arduino Due.  I'm attaching links to explain this and give you port tables.  I hope you will still be working on this when I get done, I'll enjoy having someone to work with.

Arduino port table and explanation

Arduino Due port layout


© 2022   Created by Geoffrey L. Barrows.   Powered by

Badges  |  Report an Issue  |  Terms of Service