Connect with us

How can I program a microcontroller to read binary?

Discussion in 'Microcontrollers, Programming and IoT' started by exiton12345, Jan 21, 2013.

Scroll to continue with content
  1. exiton12345

    exiton12345

    2
    0
    Jan 19, 2013
    Hello friends,

    I have a little problem, so can anyone please help me?

    I have a micro-controller and I want to read binary a digital signal (for instance 111001011).

    When I program the micro-controller to read binary I want to take in account the following: I/O, CLK and GND.

    The binary information should not be displayed on a screen but it should be written on a memory by this way when I want to see the binary code I can read the memory using a serial connection ... or something else...

    By this way if I want to see the binary I can read the memory and see what is there.

    Can anyone give am an example or at least give some references, it does not matter what type of micro-controller.

    Thanks!!!!
     
  2. GreenGiant

    GreenGiant

    842
    6
    Feb 9, 2012
    you are rather vague in your question

    The binary signal, is it a series signal or parallel? (is it going to be a string of data to one pin or one bit of data on multiple pins?)

    How fast are you going to feed it binary numbers?

    What do you want to translate it to? (HEX/OCT/base 10/ASCII etc?)

    How many data points are you going to want to store for later viewing?
     
  3. sjgallagher2

    sjgallagher2

    17
    0
    Jan 27, 2013
    If you know how long each set is gonna be, all you need is a clock, and the input stream. When the clock is high, record the current input immediately (edge triggered) as a 1 or a 0 and store in a small part of memory. After your set data length is reach cut it, save the full set of binary, and record the next.
    There's not much else to say without knowing specifics: What microcontroller do you have? If you don't have one, all you need is something like a PICAXE, cheap and simple. I'll write a code that will record binary, in BASIC.

    that is some really choppy non-user-friendly code that is on a constant take input, send output cycle, if you want to use a button or addresses or something to retrieve data then this is the furthest thing from what you want, but you get something of an idea. Also this uses an internal kinda clock, it reads every 100 milliseconds and stores whatever is there. Preferably you will have a clock input. Is this helpful at all?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-