1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

wish to learn microcontroller....... need your help

Discussion in 'Microcontrollers' started by ikelectro, Apr 6, 2013.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    Try this little bit of code for starters
     

    Attached Files:

  2. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    I'm writing the program, but actually what means by : org, setb, seta, inc etc???/ suppose they are commands but what they stand for or what they do??:confused::confused::confused:
     
  3. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    i'm not understand this....



    I wrote the program in the simulator...

    yes. it's working. LEDs are blinking......
     
    Last edited: Apr 10, 2013
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. absf

    absf Active Member

    Joined:
    Jun 18, 2012
    Messages:
    206
    Likes:
    27
    Location:
    Malaysia

    That was a nice tutorial for beginner. Are you going to add in lessons and chapters as time goes on and publish it as a full tutorial ?

    I don't mind to become another beginner to relearn 8051 from fresh as I have forgotten most of them already. My old 8051 board has a monitor program inside and communicate with the PC via COM port. I used the ASM51 and MSKermit to talk to the 8051 board.

    Allen
     
  6. Brevor

    Brevor Member

    Joined:
    Feb 3, 2007
    Messages:
    528
    Likes:
    14
    Location:
    Chicago USA
    Im with you there Ian, The paged memory is my biggest gripe about the PIC's
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    I have done one for the PIC using MPLAB... I will do a tutorial eventually if its what people want..
     
  8. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    Hello Ian,

    what the code you posted last day is working on simulation.
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    Sorry!! I don't understand?
     
  10. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    i want to say that : the code or program you posted in pdf file for me as a tutorial, is working in the simulator.....
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    Oh good... Tell me what you want to do next... I'll try and give you a lift up!!
     
  12. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    thanks. next i want:: what is BIT ADDRESSABLE MEMORY.
    what can it do exactly. i'm little confused in here.



    can we only write a program only in rom?
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    Bit addressable are SFR's locatioons 0x80 to 0xF0 and a small 16 byte memory locations 0x20 to 0x2F.

    Bit access is great for boolean flags on/off variables..

    Code (ASM):
    flags equ 0x20

       setb   flags.0 ; access bit 0 of the flags variable
     
  14. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    plz correct me :

    Code (text):
    setb  24h
    does that mean if I write this, the value of 24h is becomes 1 (high). and if I can access this 24h to the pin of micro P1.0 then the value of the P1.0 becomes . Am I right????
     
  15. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    what does it mean by? truly I'm really can't understand this... As far as I know the bit addressable memory and the SFR has their own different locations.. some registers are bit addressable?????????:confused::confused::confused::confused:
    im totaly lost here......
     
  16. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    Bit addressing only means you can access a single bit in a byte

    ie...

    Code (ASM):
    flag   equ   24
       mov   flag,#0xFF   ; move 0xFF into flags <<-- byte addressing
       clr    flag     ; clear flags
       setb   flag.1   ;  set bit 1 in flags <<-- Bit addressing
     
  17. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    Now what will be next for???
    I'm now reading the SFR in the dpdf.....
     
  18. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    Hi Ian,
    is there anything to have a look for me... ?:confused:
     
  19. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    You ask me the questions and I'll try and answer you....

    What would YOU like to try and do next...
     
  20. ikelectro

    ikelectro Member

    Joined:
    Aug 25, 2012
    Messages:
    388
    Likes:
    4
    Location:
    Kolkata, Proud to be an Indian.
    I want to make lighten up 8 LEDs in different way. And also want to understand the CODE/Program, how it works... thanks in advanced....:)
     
  21. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    Make a little stripboard or breadboard with 8 LED's on and 8 270Ω resistors and connect it to the port of your choice.... P1 is favorite..

    We can make the code once you have everything...
     

Share This Page