Jump to content

Anyone Arduino...?


Recommended Posts

Hi Guys..

Has / does anyone use the Arduino..? For anything, not just RC..

I've been dabbling with PIC processors for a few years now, with limited success. The only programmer board I found was the Maplin one, but its a serial interface. So, it's running thru a PCMCIA serial adapter, on my ancient laptop (P4 1.8g), which I believe is the issue.. It only burns properly about 1 in 10 times and doesn't correctly identify the chip.. I'm fed up messing about with IRQs, baud rates, etc, so wandered if the Arduino would suit my needs..?

My needs are simple.. Flash LED's, PWM'ed, multiplexed if required, and servo read n write.. I appreciate the Arduino is capable of far more, but i'm fed up with the PIC programmer..

Any experience.. ?

Luv Chrisie.. xx

Link to comment
Share on other sites

Hi Chrisie
I've spent a lifetime doing (& teaching) assembler programming on microprocessors such as pics, 8051, 80x86, right back to the z80, 6800, sc/mp and so on... but only recently tried an Arduino for the first time. I was utterly gobsmacked - its so easy its almost cheating! everything complicated has been done for you, leaving you to tie a few routines together with a simple script - if you've done some pic stuff you will find these unbelievably easy to get along with. The format is based on c++ but pretty much mirrors any modern hll - its very readable. It has tremendous support, it seems everyone uses them, and they're also really cheap. I'm not a convert as a lot of my stuff is synchronous cycle-counting code where the pic excels. But the Arduino is a quick, cheap and very easy way to get a project off the ground!
Cheers
Phil

PS for your pic stuff I'd recommend the pickit 2, about £40 for a real one but you can buy clones for about £25. Its USB so no messy serial comms to configure.  Dont bother with any of the IDE, debugger, ICE etc its not necessary, just the pickit 2 programmer and mpasm is all you need. To create/edit source I use good old windoze notepad.

 

Edited By Phil Green on 18/06/2014 01:22:32

Link to comment
Share on other sites

Cheers Phil.. wink

Sounds like it's worth a bash then.. I used to be a programmer, Cobol on a MF, then on Unix.. Learnt asm on an EMMA at college, and hated it at the time, but when I re-started, for pleasure, I thought BASIC was cheating, and the 'proper' way was asm..

Love the PIC, and its ease of use, but as mentioned, my Velleman board is doing my head in...

I might invest in a new USB board, but, as you said, Arduino n Pi are the new big thing.. Maplin have reduced their PICs to just 2..! Fortunately one is the 628 I use, but it's only a matter of time...

I've never really got my Rx PWM reading quite right on the PIC, but having looked at some 'sketches' online, it appears to be a couple of lines now..!

I like the tiny nano boards, but think I'll start with a normal one, to make fiddling easier..

Just found out I'm not working today, so will see if Maplin have stock...

Thanks alot Phil, much appreciated, especially from someone with your background..

Luv Chrisie.. xx

Link to comment
Share on other sites

Hi Chrisie

the pic can read the pulse-width of a receiver channel output entirely in hardware, no code necessary and its accurate to 1uS. If the pic in question can invert /T1G then connect the receiver signal directly to T1G, if not connect the receiver channel to the pic comparator input. set up the comparator as a simple inverter. Connect the comparator output to the timer gate. This is necessary for the 12F675 as the timer gate is inverted, ie low enables the count, high stops it. Clear the counter, wait for the channel to return low. The timer now contains the pulse width to 1uS resolution with the internal 4mhz clock.
Dont forget to range check the result to avoid out-of-spec pulses (permit say .8ms to 2.3ms). Polling for completion, range checking and whatever processing requires no more than just a few lines of assembler. Keep it Simple!!!
Phil

 

Edited By Phil Green on 19/06/2014 14:43:40

Link to comment
Share on other sites

Chrisie

I have never touched an Arduino, but have tinkered with a Raspberry Pi. If you have unix experience the linux OS will be familiar. And of course you do not have to footle around in assembler, you can use much higher level language.

Plummet

Link to comment
Share on other sites

LOL... pfft..

I got one this afty.. I want a mini/micro for the planes, at £10 each, only twice a PIC, but for ease of trial messing about, I got an UNO for £25 from Maplin..

Compared to the PICs, where you have to source and research project parts ( i.e. Gps, accelerometers, etc ) the Arduino is all done for you... 10 years ago I would appreciate the challenge, but for its simplicity, and potential time from idea to complete project, its unbeatable...

I just got it all setup on my old laptop, rebooted laptop, picked up tablet, and found an app thats a complete IDE on my tab.. BONUS... So I messed about with that instead, now its 2am, and i still haven't got round to actually plugging it in, on either pc or tab, to see 'Blink' in action...

Luv Chrisie.. xx

Link to comment
Share on other sites

I've done some Arduino stuff.

Effectively built a Tx using an Arduino for the encoder and a FrSky 2.4GHz Tx module did the job it was supposed to a treat. Various other R/C based experiments with them too. As Phil says, once you get up and running they're great and with all the available libraries it's a bit like digital Lego.

The Arduino Cookbook from O'Reilly is an excellent introduction and gives you a feel for the staggering versatility of the little beast from flashing lights to serving information to the web, with R/C and stepper motor driving etc (my main areas of interest) somewhere in the middle.

Alan

Link to comment
Share on other sites

You can get the Arduino Uno R3 ( or a clone ) from China via eBay for less than six quid. Same for an Ethernet shield. I've bought every sensor under the sun from eBay and most of them are like a couple of quid posted,

You can get cheap LCD displays starting at a couple of quid and add an I2C to parallel adapter for a quid. You can then drive it using only two data lines.

if you like what you have made, you can flash the software into a standalone chip which costs about three quid.

You can get the TL866 programmer for about thirty quid that will program many different types of devices.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Guys..

This Arduino is almost annoyingly good.. Annoyingly, because i`ve achieved more in a week, than 5 years faffing with PICs..

I did get the PIC working enuf to get navs on my heli, with beacon, double and triple strobes. No inputs, just run sequence..

Well I replicated thats on breadboard in 4 hours. That included wiring it up and coding from scratch (to test my new skills). And I only got 2 compo errors, one missing semi-colon and a wiggly bracket pointing the wrong way. Excellent..

2 hours after that I had a fully working button that cycles thru a flash sequence for the two strobes, Single & Off, Single & Single, Single & Double, etc, upto Triple & Triple..

30 mins after that, I was storing the selected sequence to EEprom, so it will continue after reboot..
All dreams on a PIC..


This week i`m doing `Landy Lites` for my RC Landy, with it`s recently converted Dx6.
Reads the 4 primary channels

Flicking the Elevator down n back to centre, cycles Sidelights, Dipped, Side, Off
Flicking Elev Up, If on Dipped beam, toggles mainbeam and spotlights On/Off
OR, if dipped beam not on, it flashes Mainbeam n spots twice
Oh, and the headlights have a `HID` startup, with that flicker n fade in thing they do

Rudder is Indicator stalk and triggers appropriate indicators, which self cancel once the steering has moved in the indicator direction then returned to centre.

If Elevator held high when left indicator triggered, hazard lights activate until toggled off.

All that is working now, with a spare AR600 and breadboard.
Tomorrow i`ll add the Brake and reverse light code.


The serial monitor has been very useful to fine tune the code around the actual Rx PWM values.

The planes and the Landy already have the LEDs mounted, but I dont intend sending the `big` UNO to the sky / muddy 4x4 bog, so I ordered 2 `A star` micro boards, and a `Teensy 3.1` today.

I just have to build a transistor`ed vero board (all high power LEDs ) to mount the Micro`s, a few header pins, and i`m sorted

If anyone wants a copy of my code, just ask. I`m an old programmer, but very new to this..

 

Luv Chrisie.. xx

Edited By Cyclicscooby on 02/07/2014 04:03:05

Link to comment
Share on other sites

hi

please see on going thread - Futaba M6 Fr Sky 2.4 ghz DIY Conversion by Paul Luby

been tweaked by Phil Green and looking like it will be a future RCM&E article if Paul can find the time to write it.

rgds

dave c

Link to comment
Share on other sites

As an alternative,

Ive been using the PicAxe programmer. I've designed Gun flash circuits, remote programmable glow drivers, Glow driver timing circuits for the field, and so far I'm impressed.

The parallel processing of the larger chips sure does make short work of a pseudo random gun flash, and recognising the pulse width in is a doddle.

Currently interfacing it with a serial OLED display for a programmable engine test bed. I have seen reviews for Arduino and they are good too. Make your choice!!!

Link to comment
Share on other sites

PicAxe is a PIC programmer isnt it..? Or is it the language too..?

I have to be honest and give PICs their due, as an ex programmer, I dismissed the 4gl languages and decided asm was the best way. Showing off i suppose, but in reality it just made it more difficult .. By using a 4gl you can bypass all the fiddly timing issues and let the background code sort it out..

I appreciate the Arduino is just a PIC on a pre-made board, but it does make a huge difference in RnD time.

The Libraries make stuff too easy. No checking stack overflows, moving data thru W all the time, carry flags, etc, just ' do that ' and it does..

Maybe i'm getting lazy in my old age, but i'm loving it...

Next question is, what to use it for next.. I'm not interested in ethernet, and all that comms stuff, but the touchscreen LCDs are tempting..

Maybe a 3axis gyro in the Landy (or plane) that displays the angle of the vehicle on a screen attached to the Tx. Like the inclinometer fitted to Shoguns, with warnings when tip angle close..?!

Its like theres so much stuff you can do with it, you cant see the wood for the trees..

Luv Chrisie.. xx

Link to comment
Share on other sites

Yep I'm lazy in my old age

It's programmed in basic (!) and yes there's almost no R&D time. For RC usage, its certainly quick enough, but obviously for tight code then ASM is your thing. For example it already has servo out commands, ADCs, pulsin command whereby the input PWM pulse is measured...

Link to comment
Share on other sites

I was suprised at the readings I got from the Rx.. Not quite the 1000 to 2000 ms range i was expecting

It could be, probably is, due to small timing errors within the Arduino/code, but the PWM values were not as accurate as I thougt they would be on a modern 2.4G radio, altho they were consistant, time after time..

I got the following values on a Dx6i with Ar600. Fresh new model memory n bind. Default settings - trims centre, 100% travel, no D/R or expo

Channel Low Centre High

Throttle 1065 1410 1910

Rudder 1135 1470 1905

Elevator 1087 1505 1910

Aileron 1085 1485 1885

Not too far off expected, but any code using it, needs to be 'fine tuned'.

Those are the Raw input values, but i'm remapping them to 255 and averaging the last 3 reads within the code..

Are these similar to your timings..?

Luv Chrisie.. xx

Link to comment
Share on other sites

I can't state the exact timings, but not far off what you have indicated. Yes, indeed there has to be some fine tuning as you say for a more demanding application, but simply when I designed the remote glow, you would set the stick to a predetermined level and slide a switch to register it for example.

When the stick was at that value, it was rock solid and repeatable, and stable (JR DMSS receiver).

I'll PM over some code for you later today so you can see.

Steve

Link to comment
Share on other sites

  • 2 weeks later...

Anyone else having reliability problems?

As an introduction to these boards I bought 5 Nanos, one from HobbyKing, the rest from a 'mid-price' ebay seller.

Of the 5 boards, the HK one arrived with a dry joint or some connectivity problem on the A0 pin - the input ignored the A0 pin and showed the adjacent A1 voltage instead. Otherwise it works ok.

Of the 4 from ebay, one has been working fine for 2 weeks then went into what seems to be a hardware failure - the firmware thats in it runs randomly, ignores reset, and it will not be reprogrammed, not via usb as the bootloader doesnt respond to the IDE, nor will it connect via ICSP, so cannot reload the bootloader.
It seems to be bricked with random content! It was run well within the specs, power supply was good, no outputs shorted or overloaded, no misconfig, it simply failed in normal service after 2 weeks. I replaced the board with another from the same supplier and using exactly the same code, and it runs fine again

Paul mentioned some scary reliability figures in his M6 thread:
   Maybe you pays for what you get. I did read on the Arduino forum that
   failure rates for non-genuine Arduino's is greater than 60%.
   Am yet to experience any failures, maybe I've been lucky.

Maybe my 2 out of 5 is unlucky but if the only way to ensure reliability is to buy genuine Sparkfun ones (they designed it) then it becomes a bit expensive! Any thoughts?

Cheers
Phil

Edited By Phil Green on 17/07/2014 00:27:28

Link to comment
Share on other sites

Although I built a Transam Triton 8080A (1.5K integer BASIC!) in 1977, I hain't a programmer nor an electronics engineer. Indeed, when I first found Paul's and Phil's threads, about three weeks ago, I hadn't got a clue what was going on, but was driven by the idea of modernising an old Remcon Quantum Six.

So, two weeks ago, I downloaded "Getting Started With Arduino" by Massimo Banzi (4 quid-odd, on Kindle) and then felt reasonably confident to order a Sintron Beginners' Kit for 39 quid (the one with the Tower Pro SG90 servo, the stepper motor and an Arduino Uno-compatible board), off Amazon.

For the money, the thing is amazing and a super intro to these things (but you need to follow a trail to get the manuals, as none are supplied in the kit). In the last week, I've successfully occulted my LEDs, said "Hello World!" on the LCD display, built a servo exerciser and even captured serial data as text, on my mac, using the Coolterm app.

Future plan is to get a GPS "shield" and start playing with that. All dead easy, just boiler-plating the downloadable library "programs", as required.

So far, the thing has been totally reliable but, this lunchtime, I discovered the 5V pin is delivering only a smidgeon more than 3.5V, when using the supplied 9V battery, as opposed to USB-supplied power. This fails to drive the 9g servo. Bummer, as it means I'm tied to the laptop .... but I'm not complaining. Might only use the genuine kit for serious stuff, in future, though.

To be researched, but no confusion with the nearby 3.3V pin and the battery appears ok.

Link to comment
Share on other sites

Concerned about the quality of chinese copy arduinos and the expense of genuine Nanos (£25+) I found that Sparkfun are doing the Pro-Mini for £7, thats the pukka-gen article as Sparkfun designed the board.
So I ordered 4 directly from America as they cost much more from RS or Farnell in the UK. Well, they arrived today, so this evening I made a little ICSP programmer board, which works great:

pro_mini_icsp_prog.jpg

The Sparkfun Pro-Minis bring out A4 to A7 too (albeit to a slightly awkward location on the board) so really, for retro refits, it seems just as capable as the Nano and a fraction of the price:

sf_promini.jpg

I cant decide which of my old 27mhz sets to do next, I've a KO Digiace which has some sentimental value as I had my first competition success with it, also I've a Logictrol 3, a couple more Krafts, a Horizon and a lovely original Sprengbrook.
Think I might go for the KO Digiace, it would feel great to fly that set again!

Cheers
Phil

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...