Arduinos and Microcontrollers ref: Rotary Table Mew 249

Advert

Arduinos and Microcontrollers ref: Rotary Table Mew 249

Home Forums Electronics in the Workshop Arduinos and Microcontrollers ref: Rotary Table Mew 249

Viewing 25 posts - 51 through 75 (of 243 total)
  • Author
    Posts
  • #270256
    Neil Wyatt
    Moderator
      @neilwyatt

      Hmm, the whole point of the article was to start discussion around arduinos and microcontrollers…

      But the correction in the first posting shouldn't be lost, I will just move that.

      Neil

      Advert
      #270257
      Neil Wyatt
      Moderator
        @neilwyatt

        Ok, done, a bit rough and ready but that will have to do. This is now a general discussion of the project & microcontrollers.

        Neil

        #270267
        Frances IoM
        Participant
          @francesiom58905

          one problem with the clone boards was not the arduino but the serial to usb chip that was often used – these were designed by FDTI (based in Scotland) but many knockoff clones appeared at much lower price – these worked per spec except in one relatively unimportant way but FDTI exploited this to install a driver under Windows that would brick any unauthorised clone – caused a great rumpus (+ threat of legal proceedings) in late 2014 so much so that Microsoft forced FDTI to withdraw the driver noting that FTDI removed two driver versions from Windows Update. Our engineering team is engaging with FTDI to prevent these problems with their future driver updates via Windows Update.

          #270300
          Carl Wilson 4
          Participant
            @carlwilson4

            My work here is done.

            #270301
            Carl Wilson 4
            Participant
              @carlwilson4

              Seriously, it is really good to see and hear about the ways in which others are incorporating microcontrollers and electronics into hobby engineering projects.

              #270305
              Bazyle
              Participant
                @bazyle

                Interested to hear about this Micromite and got distracted for an hour or so trying to find decent info about it The documentation and websites almost go out of their way not to give pinouts etc in an accessible manner.. Looks like the interpreter uses so much memory because it is probably written in C.
                I've used a number of microcontrollers and it is nice to see one that doesn't need an IDE on another computer.

                #270312
                Michael Gilligan
                Participant
                  @michaelgilligan61133
                  Posted by Bazyle on 06/12/2016 17:24:40:

                  Interested to hear about this Micromite … The documentation and websites almost go out of their way not to give pinouts etc in an accessible manner.

                  .

                  I stumbled across pages 8 and 9 of this document: **LINK**

                  http://geoffg.net/Downloads/Micromite/Micromite%20Manual.pdf

                  … Appears to be what you are seeking

                  MichaelG.

                  #270313
                  Muzzer
                  Participant
                    @muzzer
                    Posted by Bazyle on 06/12/2016 17:24:40:

                    I've used a number of microcontrollers and it is nice to see one that doesn't need an IDE on another computer.

                    But isn't that one of the (few?!) advantages of an interpreted language? There were compiled versions of Basic (eg Turbobasic) but they were the exception rather than the rule IIRC. One big issue with interpreted languages being that if you supply an illegal input or the interpreter encounters a syntax error, they have to bomb out. Bit of a problem with real time systems.

                    Murray

                    #270321
                    Bazyle
                    Participant
                      @bazyle

                      Well exactly. That's why I said it was nice to find a self contained unit. I can't run these IDEs on my locked down work laptop so have to wind up the old Windows 2000 machine. Actually most of the controllers with a 'user friendly' IDE, including the Arduino, are not full compliers but producing an intermediate code that is run by an interpreter in the chip – that's why the chips have to be preprogrammed.

                      Michael, Thanks but I had found that eventually and some details of the Micromite 64 which I think I will try out but the various boards don't have clear details on the website selling them It is a bit disorganised. But with the cheapest built and programmed board at under 15 quid it is not too painful to try out.

                      #270614
                      Journeyman
                      Participant
                        @journeyman
                        Posted by Bandersnatch on 04/12/2016 18:41:47:

                        Posted by martin perman on 04/12/2016 17:03:02:

                        I have uno's that are genuine boards and copies but they all work the same,

                         

                        You're lucky in that case. Most of the Chinese copies won't work with the standard Arduino USB driver for programming. (There is a driver, that works, available but you have to know and dig it up).

                        Thanks for the heads up regarding drivers. Bought my first Arduino Uno (clone) from Amazon. Wouldn't work on Windows 10 reporting that no driver loaded. Tried Manual driver install from the Arduino download but no joy. Remembered this thread and discovered that my clone has a CH340G usb chip and not the FTDI chip. Downloaded the driver **HERE** and all working fine even managed to install the sketch for the rotary table which appears to function. All I have to do now is fit all the bits together in a box!

                        John

                        Edited By Journeyman on 08/12/2016 11:51:59

                        #270624
                        John Stevenson 1
                        Participant
                          @johnstevenson1

                          One thing that puts me off the Arduino rotary controller is the shields has 5 ? buttons on it that you access a very deep nested menu.

                          However there are tactile keypads from China for £1.50 that work with Arduino's and even pre-written sketches.

                          Is it asking a lot to finish the job and fit one of these keypads so it makes it easier to use ?

                          #270629
                          Muzzer
                          Participant
                            @muzzer
                            Posted by Bazyle on 06/12/2016 18:16:19:

                            Actually most of the controllers with a 'user friendly' IDE, including the Arduino, are not full compliers but producing an intermediate code that is run by an interpreter in the chip – that's why the chips have to be preprogrammed.

                            I hadn't heard that and can't see any reference to any interpreted element. I understood that Arduino code is a simplified version of C++ that is compiled into machine code and uploaded.

                            There are loads of references out there and although Wikipedia is hardly the ultimate arbiter, it sates that "after compiling and linking with the GNU toolchain….the Arduino IDE employs the program avrdude to convert the executable code into a text file in hexadecimal coding that is loaded into the Arduino board by a loader program in the board's firmware." Presumably this allows the bootloader to run the code after reset? Can you point us to something that explains what you mean?

                            #270635
                            SillyOldDuffer
                            Moderator
                              @sillyoldduffer
                              Posted by Bazyle on 06/12/2016 18:16:19:

                              Actually most of the controllers with a 'user friendly' IDE, including the Arduino, are not full compliers but producing an intermediate code that is run by an interpreter in the chip – that's why the chips have to be preprogrammed.

                              Thanks to Bazyle for launching me into another useful learning experience!

                              I didn't believe the suggestion that the Arduino has an interpreter in the chip and tried to confirm that's wrong. Loads of stuff on the web implies that Bazyle is mistaken but I couldn't find anything that confirmed it positively. I ended up doing forensics on one of my own programs.

                              Normally the Arduino IDE (Integrated Development Environment) doesn't save the compiled file uploaded into the Microcontroller. It can be ordered to save it from the Sketch Menu with 'Export compiled binary'. Doing this produces two hex files; they appear to be identical except that one of them includes bootloader code. These files can be analysed.

                              A hex file can be disassembled a command line utility called avr-objdump. Although this was downloaded with the IDE it is not installed (at least on linux), so using it involves typing in full pathnames, or copying everything into the same directory.

                              Then this magic incantation disassembles the binary file, ie converts machine code back into assembly language. My example program is in monitor.ino.standard.hex, and objdump writes the decode into a new text file called hum.s:

                              ./avr-objdump -j .sec1 -m avr -d monitor.ino.standard.hex > hum.s

                              Inside hum.s is the evidence, and it looks very much like AVR assembly language to me, not interpreter tokens:

                              avr_disassemble.jpg

                              That's the case for the defence m'lud. I suspect Bazyle has misremembered how this particular microcontroller works, he's quite right that others interpret.

                              Normally using an Arduino is much easier than this, but it's useful to know that the IDE comes with a full set of advanced software tools, hidden away though they are.

                              Dave

                              After posting, discovered that muzzer got in first!

                              Edited By SillyOldDuffer on 08/12/2016 13:38:30

                              Edited By SillyOldDuffer on 08/12/2016 13:41:04

                              #270640
                              Les Jones 1
                              Participant
                                @lesjones1

                                It is possible to see the assembler listing of the compiled "C" program. The details are on this web page.

                                Les

                                #270641
                                John Rudd
                                Participant
                                  @johnrudd16576

                                  Oops…deleted in error…I'll try again…

                                  Edited By John Rudd on 08/12/2016 14:21:55

                                  #270646
                                  Neil Wyatt
                                  Moderator
                                    @neilwyatt

                                    Arduinos use AVR chips inside.

                                    These have a 'Harvard' architecture with separate program and data memory spaces (EEPROM and RAM), although the distinction has become academic as EEPROM is unreliable and awkward to program and newer instructions let you directly read and write to the much more reliable and long-lived (in terms of r/w cycles) flash.

                                    You can write programs for AVR in any language that has a suitable compiler to AVR machine code, and the Arduino standard is a version of C used through the 'Sketch' program.

                                    Most AVR users use GCC (GNU C Compiler) together with WINAVR.

                                    Studio 6 the AVR development environment can supporet multiple languages ( ) although it only has programming support for 18 and 32-bit AVR GCC, AVR assembler and ARM built in (i.e. you need to add a compiler).

                                    For my sins I write most of my code in AVR assembler because I'm a hair-shirted 8-bit obsessive.

                                    Arduinos are really only AVRs with a pre-programmed bootloader on a dedicated pin-out board. they can be programmed as ordinary AVRs OR an ordinary AVR can use the Arduiino bootloader and have greater flexibility of how you use the pins.

                                    You CAN have an interpreter running on AVR, I know because I have written a version of BBC BASIC that runs on an AVR although that link is just about the display driver.

                                    As I've mentioned its well worth looking at Atmel's website and AVRfreaks website if you want to really take these chips to the limit whether or not you use arduino boards.

                                    Neil

                                    #270648
                                    Neil Wyatt
                                    Moderator
                                      @neilwyatt

                                      Not for the faint-hearted, this is what Studio 6 looks like, a bit more complex than the Arduino sketch tool, but it does make sense in the end…

                                      studio 6.jpg

                                      #270655
                                      SillyOldDuffer
                                      Moderator
                                        @sillyoldduffer
                                        Posted by Neil Wyatt on 08/12/2016 14:28:24:

                                        For my sins I write most of my code in AVR assembler because I'm a hair-shirted 8-bit obsessive.

                                        You CAN have an interpreter running on AVR, I know because I have written a version of BBC BASIC that runs on an AVR

                                        Neil

                                        Now that combination is impressive! How on earth do you find the time?

                                        The method shown in Les Jones link didn't work for me on linux with version 1.6.8. It's a pity because you get to see the 'C' being converted to Assembly and the machine code as well. As far as I can tell, Arduino 1.6.8 on linux doesn't write any temporary files, or if it does they get deleted. Might be different on Windows, I shall fire it up and have a look later.

                                        Dave

                                        #270665
                                        Zebethyal
                                        Participant
                                          @zebethyal

                                          The Arduino AVR creates temporary files on all versions (I use the MAC one), but normally deletes them once it has finished with them.

                                          There is a an entry you can add to preferences.txt that will prevent it from deleting all of these temporary files, along with the hex files.

                                          export.delete_target_folder=false

                                          You only need pre-programmed chips (bootloader pre-installed) if you are using the bootloader to help load your program or you want to upload via the USB connection on the board.

                                          If you want to save the space used by the bootloader and/or program the chip directly, or buy blank chips and program them on your breadboard, you can do this via the ICSP connection and a suitable programmer like a USBasp, AVRISP or USBtinyISP, any of which can be bought for less than £3.00, some for less than £1.00.

                                          If you do put a bootloader on, you can then upload programs via the serial pins by resetting the chip at the right point during the compile, such that the bootloader is looking for new code as you are attempting to talk to it from the IDE, if you time it wrong, the bootloader simply loads whatever code is already programmed on the chip (if any).

                                          The first time you program a brand new chip, it may need some different fuse settings as it may be set to the factory default clock speed of 1MHz, which may not be supported by all programmers (some have an additional jumper to allow use at that clock speed).

                                          Edited By Zebethyal on 08/12/2016 15:30:24

                                          #270674
                                          SillyOldDuffer
                                          Moderator
                                            @sillyoldduffer

                                            Thanks Zebethyal, that preference keeps all my build files, which are stored in /tmp

                                            The only problem now is that the elf doesn't have any debug info in it, so the C source is missing from objdump's output. I'm wondering if gcc flags can be set as a preference. Hmmm.

                                            Cheers,

                                            Dave

                                            Edited By SillyOldDuffer on 08/12/2016 16:08:34

                                            #270697
                                            Neil Wyatt
                                            Moderator
                                              @neilwyatt

                                              More seriously, I googled 'pic microcontroller rotary table' – still some false positives as PIC means short for picture, 14,000 results. Substituting AVR gave over 45,000 and ardiuino well over 100,000.

                                              the magazine has no bias, the bias is in the numbers of people using different types of micro for workshop projects.

                                              Quite happy to feature some PC projects, but I would worry about 8051, 6502 or even Cray X-1 as minority interests

                                              Neil

                                              #270700
                                              Frances IoM
                                              Participant
                                                @francesiom58905

                                                Neil
                                                how about a 4040 project – I still have one (probably never used) + support chips – not 100% sure they have survived the last 35yrs tho as bought as spare for a student project I was supervising and forgotten about for years.

                                                #270743
                                                Cyril Bonnett
                                                Participant
                                                  @cyrilbonnett24790

                                                  **LINK**

                                                  Might be of interest.

                                                  #270846
                                                  Engine Builder
                                                  Participant
                                                    @enginebuilder

                                                    I am very interested in the step index project.

                                                    I already had an Arduino uno and thought I would by the LCD shield to convince myself it works before getting the motor and driver. I am not up to speed with the programming.

                                                    I have uploaded the sketch and fitted the shield but it's not working quite right, unless this is because the other parts are not installed.

                                                    On power up I get the version number displayed and then SELECT MODE and MODE = STEP which is correct.

                                                    When I press the SELECT button nothing happens. Pressing LEFT, UP or DOWN scrolls between STEP,TEMP,RUN and JOG. RIGHT does not do anything.

                                                    Is it possible the LCD shield is faulty?

                                                    I would appreciate any suggestions anyone can offer.

                                                    #270848
                                                    john swift 1
                                                    Participant
                                                      @johnswift1

                                                      Hi

                                                      I don't have an arduino uno and LCD + switch sheild but

                                                      pre empting buying them to experiment with I have found conflicting notes about the LCD sheild

                                                      it seems that some boards you can only use D10 to switch the display LED backlight on & off

                                                      others you can use PWM to contol the brightness

                                                      this is what I have so far

                                                      pwm brightnes mod lcdkeypad_shield_sch.jpg

                                                      John

                                                       

                                                      PS

                                                      routine to read keys

                                                      int read_LCD_button()     // routine to read the LCD's buttons
                                                      {
                                                        int key_in;
                                                        key_in = analogRead(0);      // read ADC
                                                        // average values for my board were: 0, 144, 324, 505, 742
                                                        // add approx 100 to those values to set range
                                                        if (key_in > 1000) return NO_KEY;    
                                                        if (key_in < 50)   return RIGHT_KEY;  
                                                        if (key_in < 250)  return UP_KEY;
                                                        if (key_in < 450)  return DOWN_KEY;
                                                        if (key_in < 650)  return LEFT_KEY;
                                                        if (key_in < 850)  return SELECT_KEY;  
                                                      }

                                                       

                                                      hope you can now check your keys

                                                       

                                                      Edited By john swift 1 on 09/12/2016 16:48:53

                                                    Viewing 25 posts - 51 through 75 (of 243 total)
                                                    • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                                    Advert

                                                    Latest Replies

                                                    Viewing 25 topics - 1 through 25 (of 25 total)
                                                    Viewing 25 topics - 1 through 25 (of 25 total)

                                                    View full reply list.

                                                    Advert

                                                    Newsletter Sign-up