what's the process of embedding computer code into electronics?

Discussion in 'OT Technology' started by HardTech, Apr 3, 2006.

  1. HardTech

    HardTech hungry

    Joined:
    May 5, 2000
    Messages:
    28,103
    Likes Received:
    1
    Location:
    NorCal
    for example, how would you go about programming a garage door opener and then using that code and having an actual product?
     
  2. EvilSS

    EvilSS New Member

    Joined:
    Jun 11, 2003
    Messages:
    5,104
    Likes Received:
    0
    Location:
    STL
    The code is stored on a rom/prom/eprom and executed by a light-weight microprocessor (8-bit proc's are popular for electronics). Usually done in assembly (specific for the processor used) and burned/flashed onto the rom. There are usually emulators available to use to test the code against.
     
  3. HardTech

    HardTech hungry

    Joined:
    May 5, 2000
    Messages:
    28,103
    Likes Received:
    1
    Location:
    NorCal
    what about java-based electronics?

    will C++ work?
     
  4. EvilSS

    EvilSS New Member

    Joined:
    Jun 11, 2003
    Messages:
    5,104
    Likes Received:
    0
    Location:
    STL
    I'm not aware of any simple electrionics that use higher level languages, but this is way outside my field. You see Java based cell phones and other complex electronics, but I've never heard of a Java garage door opener. Considering how java works I doubt you would. Some processors may have C compilers than can be used. Again, way outside my field.
     
  5. Yep

    Yep Knick knack paddy whack, give the old dog a bone

    Joined:
    Jan 22, 2001
    Messages:
    4,603
    Likes Received:
    0
    Location:
    South Jersey
    Most of it is all done in assembler. My old assembler professor use to program cell phones in assembler. But that was years ago. I bet by now, as complex as phones are, they're using something higher level.
     
  6. HardTech

    HardTech hungry

    Joined:
    May 5, 2000
    Messages:
    28,103
    Likes Received:
    1
    Location:
    NorCal
    what about controlling stuff via a Java interface?

    For example, instead of having a Java-based garage door, you can control the garage door from a Java application
     
  7. Yep

    Yep Knick knack paddy whack, give the old dog a bone

    Joined:
    Jan 22, 2001
    Messages:
    4,603
    Likes Received:
    0
    Location:
    South Jersey

    You can do it, but you usually end up interfacing with a microprocessor of some sort.. or at the very least a simple circuit.

    Computer's aren't really designed to output the kind of power needed to trigger a garage door opener. What you'd usually have is a user interface, some low level driver, and then a hardware circuit. For instance, you plug in some sort of adapter to the usb port. your java app interfaces with the usb adapter (ie sends a command to open garage door), the USB adapter then handles the task of sending power to the garage door or completing the circuit.
     
  8. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    Cell phones are now using Java. Memory are cheaper and smaller that I don't think assembler is used much. C is also used for palm pilots and the like. Computer engineering, electrical engineering, and mechanical engineering students in my undergraduate college teamed up to create a robot. Their code was done in C++.

    Check this out:
    http://computer.howstuffworks.com/rom.htm

    Just about to read it myself.
     
  9. HardTech

    HardTech hungry

    Joined:
    May 5, 2000
    Messages:
    28,103
    Likes Received:
    1
    Location:
    NorCal
    yeah, I figured as much. I was just wondering how possible or easy it would be to have something like a computing "brain" in the home to control security and some maintenance tasks, like watering the garden or setting the A/C

    :hs:
     
  10. EvilSS

    EvilSS New Member

    Joined:
    Jun 11, 2003
    Messages:
    5,104
    Likes Received:
    0
    Location:
    STL
    You could always use the existing X10 stuff. If not there are plenty of relay devices you can program against.
     
  11. Yep

    Yep Knick knack paddy whack, give the old dog a bone

    Joined:
    Jan 22, 2001
    Messages:
    4,603
    Likes Received:
    0
    Location:
    South Jersey
    Yeah, if you're just looking for simple functionality X10 would probably do what you're looking for.
     
  12. agent0068

    agent0068 OT Supporter

    Joined:
    Jun 28, 2002
    Messages:
    39,833
    Likes Received:
    0
    embedded code does not have to be done in assembly. for very simple devices, yes, it probably is in assembly as it's just cheaper and quicker to get up and running. but just look around you at all of the electronics you have--do you honestly think somebody sat down and added all the functionality in assembly? your phone, your car's navigation system, etc. And how would the work be done by a team of software engineers--do you think people could work collaboratively and effectively on assembly? people have enough trouble doing that in high-level languages with good version control setups.

    variants of C, ada, etc and other high-level-but-still-semi-low-level languages are popular in the embedded world. it just usually amounts to using a different lightweight OS, compiler, processor, memory scheme, etc to use your code.
     
  13. EvilSS

    EvilSS New Member

    Joined:
    Jun 11, 2003
    Messages:
    5,104
    Likes Received:
    0
    Location:
    STL
    Yea, but there is a world of difference between a cell phone or car nav and, say, a microwave. The example given was for a garage door opener and at that level of device it's still mostly done with ASM.
     

Share This Page