New to microcontrollers

Discussion in 'Embedded Systems and Microcontrollers' started by conanav, Jun 14, 2008.

  1. conanav

    Thread Starter Member

    Jun 14, 2008
    14
    0
    Hello All

    I am a physics Phd. student and only recently I have become interested in microcontroller and microprocessor programming due to requirements in the lab im currently working in. I have a couple of general questions about possibilities of either of these devices. I have some very very basic knowledge of the devices but i cannot encompas it yet to even known if im able to do particular things i'm interested in, or which device(PIC or straight microprocessor?) might be better for a particular task:

    So my questions are:
    1. Is it possible to configure your microcontroller in such way that it will allow the user to input a particular number that will correspond to the desired pulse delay. In other words, if i enter let's say 500 using a connected keypad, is it possible to control the built-in clock(let's say 10MHZ)to set one of the outputs to HIGH for the desired amount of time(either 500 clock pulses, or better yet 500 ns/us/ms/or even seconds)? I'm know this might probably require some intense coding but im just asking if it is reasonably possible.

    2. Is it possible for the microcontrollers to collect data? I know that PIC units have built in D/As and A/Ds and flash memory so my question is if it is possible to code it in such way that it will store analog data from a particular input pin and allow me to execute let's a mathematical operation on it. For example is it possible to collect voltage readings at two different times and then compare and, let's say display the difference between them using an LCD panel.

    3. Expanding on the last question, is it possible to code the PIC in such way that it will allow me to perform mathematical operations. In other words, is it possible to use let's say PIC18F, connect it to a keypad, and code it so it performs like a calculator. I know that some of the advanced calculators use Motorolla 68000 CPUs, so is it only possible to code such operations using microprocessors directly?

    4.As most of you will deduct from my questions, my knowledge of MCUs and CPUs is lacking, so what books would you guys recommend to learn about the subject? There is so many of them on the market and I already bought 3 but some of them seem a little outdated since they don't even mention PIC18s.

    Thanks for the help guys
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Take a look at this thread for a several member's opinions on the pros and cons of PICs and AVRs.

    hgmjr
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Here is a link to a post containing all of the links to the various hardware and software tools available in support of the ATMEL AVR series.

    The AVR is well worth considering for is free software tools alone.

    hgmjr
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
  5. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The AVR and the PIC are both able to do pretty much all of the things you have mentioned in your original posting.

    hgmjr
     
  6. conanav

    Thread Starter Member

    Jun 14, 2008
    14
    0
    Thank You for such quick responses. Judging from them you are in favor of AVR MCUs, but unfortunatelly I already bought the PIC18F2520 MCU plus the programmer so i guess for now i'm stuck with it, as far as the learning goes. I'm assuming that the coding process is the same for both MCUs, in semantics at least, so if i learn one i can probably switch to the other one if AVR is better.

    As far as my original questions, do the things i mentioned require a lot of knowledge of the coding process or are they typical things that MCUs are used for?
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    You will need to use C-language to do the math operation since you are not that comfortable with microcontrollers.

    Otherwise, you should be able to do pretty much anything you need to do. The only limitation I foresee is that volatile RAM is at a premium. in the PIC and the AVR.

    hgmjr
     
  8. theamber

    Active Member

    Jun 13, 2008
    318
    0
    With the uC o uP as a stand alone separated from a PC it would be very challenging. Questions 2 and 3 yes, and much easier with PICs than with a uP. A uP will need a lot more of supporting harware. For example go to:
    http://www.lupinesystems.com/calc/lcdsoft.htm

    There are also a lot of info on the net about Pics being used as Data Adquisition DAQ.
    About question 1, I think you cannot do that. But is possible that you could find a way of generating arbitrary Pulses from an external oscillator and then being controlled by the uC.
    I think is going to be very hard to find specific books about that particular PIC18f. You will have to adquire the data sheets specifications which are free from the manufacturer and use the knowledge from other Pics and apply it to yours. I hope this helps you and keep us updated of your progress.
     
  9. nanovate

    Distinguished Member

    May 7, 2007
    665
    1
    Question 1. --> no problem. I have used an LCD and a keypad interface. You can also use the UART w/max232-type transciever to use hyperterminal in Windows to communicate w/the uC

    Q2 --> Depends on how much data... generally it collects then stores to another memory device

    Q3 --> It can do math but 8-bit math is most efficient

    Q4--> Look at Tim Wilmshurst's book about the PIC. It is supposed to be good.
     
  10. m.majid

    Active Member

    May 28, 2008
    39
    0
    i suggest PIC is more proffessional than AVR.

    i recommend u to start PIC µController.

    start PIC with this book:

    "PIC Microcontroller and Embedded Systems"
    By:Muhammad Ali Mazidi
    Publisher: Prentice-Hall
     
  11. Salgat

    Active Member

    Dec 23, 2006
    215
    1
    More professional in what manner? I thought both were used widely in industry.
     
  12. m.majid

    Active Member

    May 28, 2008
    39
    0
    such as stability against noise, in industrial environment
     
Loading...