Assembly programming need help ?

Discussion in 'Programmer's Corner' started by saha, Jun 2, 2006.

Thread Status:
Not open for further replies.
  1. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    hi,
    If there is anyone who needs help on writing program for 8051 based processor, i can write program for your hardware. but you need to specify what actually your program must do. if you feel that your application is much confidential, you can simply give the logic of execution (like port p1.0 goes high 500ms after port 2 receives the byte AA ) of the firmware.

    Ive got enough experience on designing systems based on 89C51,89C52,89C54,89C1051,89C2051,89C4051. from a small 3 component board to a complex system with 16 bit ADCs, DACs,Mux, LCDs,Serial EEPROM,EEPROM 128KB etc.

    "WHEN WE SHARE WE CREATE POWER"

    Regards
    saha
     
  2. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    HI,

    HERE IS THE ASSEMBLY CODE FOR TRANSMITTING AND RECEIVING DATA THROUGH SERIAL PORT OF 89C51/52/54/1051/2051/4051 MICROCONTROLLER.
    assemble this code using metalink assembler available at www.iguanalabs.com.


    regards,
    saha
     
  3. walter

    New Member

    Mar 31, 2006
    1
    0
    Hi,

    Do you maybe have a similar Tx n Rx sourcecode,but using 16F877 assebler language

    Thanx
     
  4. raju shiradwade

    New Member

    May 20, 2004
    1
    0
    Hi saha
    I am raju. I think you are the right person, who will help me.
    I used IC 89c52 to interface PC with max232. In PC there is win98 operating system. I made serial program in VC6. that dll i called in VB6. It is working very good.
    But Now I am checking in WIN XP operating system. But error is coming "no procedure in dll entry" like that. Can u help me.

    One more question, MScomm in vb for serial program with 89c52.
    I am facing problem. all data is coming correct. but 6th and 8th bit is not coming proper. Please help me saha.

    If you are having any other program in Vb which will work Operating system win98 , XP.


    "WHEN WE SHARE WE CREATE POWER"

    Regards
    raju
    id " sraj_ich@yahoo.com"
     
  5. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    Hi Raju,

    Iam sorry that i couldn't help you by providing a VB r VC code but you follow this link to get the related details . also iam attaching a sample of C code that i've used initially for building applications. It is actually an extract from the same site. but i find it really good. see one more thing is like win98 winXP will not allow you to access the on board ports. there are some dll files need to be added. but i haven't tried it in win XP. ALso for your second question if all other bits are coming correctly then the 6th and 8th bit should also come correctly.

    The problem will be in the communication settings either on the PC side or on the controller side

    see the hyperterminal port settings usually it will be Baud rate : 300/ 1200/.. etc
    parity : none
    stop bits : 1
    flow control : none

    Before connecting your hardware with the PC.

    solution1 :

    1. try some small VB CODE or VC code to transmit a single byte. wait till a byte arrives and display it and then transmit the next byte.

    2. run the exe file after shorting the 2nd and 3rd pin of your 9 pin male connector at the rear side of your PC. actually this will short the TXD and RXD pins of the serial port. hence as the PC is executing the exe code the data you are transmitting will be received by the PC itself. the result is you must get the data (which you have transmitted) displayed on your PC.

    solution 2:

    1. try this small piece of code written for 8051 microcontroller. open the file and read the comments and this will give the req info what the program will do. The hyperterminal settings are same as above. the communication cable is a cross RS232 cable.

    Solution 3 :

    Transmit the code AA , 55, DD,33, 00, FF from microcontroller or from PC. observe the bit pattern and you can know why we send these pattern.


    This link will give some useful info about serail ports

    http://www.beyondlogic.org/

    please do check up with the code and let me know where you are hanging. you can attach your controller code so that i can see whether the setting are right.


    regards,
    saha
     
  6. ashwinv

    New Member

    Jul 2, 2006
    2
    0
    HI, I've written a code for 24c04 serial eeprom but it can access only the first 256bytes after which it overwrites the previously stored data. The data sheets says to alter the A0bit of the device address byte, i did that and i was able to acces the upper 256bytes but the problem is to access the whole 512byte location continuoulsy. that is, i'm continuously writting data from 00h and once it reaches 0ffh of the first page the code should automatically shift to the 2nd page's 00h location. can u help????
     
  7. ashwinv

    New Member

    Jul 2, 2006
    2
    0
    Hello Saha, it would be great help if you give me the ADC and DAC codes along with circuit diagrams to interface with an 89c51. Thanks in advance.
     
  8. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    Hi,

    Presently iam not having a separate circuit for ADC or DAC interfaced with 89c51 processor. but if you are building one use PCF8951 a philips product which has 8 bit single channel ADC and 4 channel DAC. see it is really easy and as simple as that . In ADC there are two signals i.e SOC -Start of Conversion. Busy - To intimate the processor that the conversion is over. and the data lines need to be directly connected to the AD0-AD7 of the processor. You need to make it SOC high for few microsecs as said in the data sheet and check the busy whether it is low or not. if low then get the data from the data line compare with the input. The DAC IS much more simple. Keep the data and give the latch pulse . The output will be available. there is nothing tough in desigining your own. best wishes. Should you have any problem i'll help you. Iam making a good general purpose board and very soon it will be out in this forum with circuits and everything. Iam in the process of compiling my detailed works with small applications. and you get everything you need. If you have any problem please sketch it out and attch it. A picture could speak a million words. Also write your spec. Pls put your problem with out any ambiguity.


    regards,

    saha
     
  9. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    Hi ashwinv, It is better you go through the data sheet of the 27c04 eeprom. it says that you can access the data as two blocks of 256 X 8 bit locations only. You need to change the status of pins . go through this.

    http://f4eru.free.fr/robot/Maggie/Accu/24C04.pdf


    bye for now
    saha
     
  10. hohozai

    New Member

    Jul 24, 2006
    1
    0
    hello Saha,it's great to know you as i really need your help.let's tell u bout my task first. I am given a task on designing a simple memory game using 8051 microcontroller.I have to design,simulate and construct an 8051 microcontroller system.
    The operation should run as below:
    1.the system has a set of 8 push buttons and 8 LEDs.
    2.Each switch and LED is representing a unique musical note.
    3.A note is produced and the LED glows when a switch is pressed.
    4.The game starts by randomly playing some musical notes(one not at a time) and turning on the corresponding LED.
    5.The player is required to repeat the correct order by pressing the switches.
    6.if the correct order is produced,the game proceed to the next level(longer sequence of musical notes in a shorter time)
    7.if the order is wrong,the game restarts.

    here's are the component that i m goin use in my assignment.
    (1 piece) crystal 12 MHz , (1) 40-way DIP IC Socket, (9) Micro-tact switch,
    (1) i kiloohm 8-way Gang resistor, (1)100 ohm resistor , (1) 8.2 kiloohm resistor, (2) 33pF capacitor, (2)0.1 uF capacitor , (3) 10 uF capacitor ,
    (1)7805 ,(1) AT89551 ,(1) project board , (8) LEDs, (2) i kiloohm resistor ,
    (1)2N2222 transistor
    maximum current per port pin : 10 mA
    maximum current per 8-bit port :port 0-26mA ,port 1,2,3-15mA.

    tat's all about the information of my asignment..i face difficulties to write the assembly language.can you help me bout tat?thanks a lot.
     
  11. maheshudr

    New Member

    Jul 29, 2006
    1
    0
    I am quite new to this field i know the basics but before putting 89c51 into some project i want to build my own programmer kit can you guide me how can i use my pc for the purpose.
    and provide me the link to downloader software and circuit.
    Saha could u pls help me?????
     
  12. gupteswarsahu

    New Member

    Aug 1, 2006
    3
    0
    hai saha ur doing a great job,keep it up
    i m from iit .in feature i need ur help
    my emai guptes7@yahoo.com
     
  13. princesmay

    New Member

    Aug 8, 2006
    2
    0
    hello im a computer engineering student and ware dealing with PIC and i want to ask if anybody can give me some saple codes with LED as an output???hope to help me...thatks
     
  14. princesmay

    New Member

    Aug 8, 2006
    2
    0
    hello im a computer engineering student and we are dealing with PIC and i want to ask if anybody can give me some sample codes in assembly language most especifically used for PIC16F877 with LED as an output???hope to help me...thanks in advance!!!
     
  15. jasper_86

    New Member

    Aug 23, 2006
    2
    0
    Saha,
    i have done a program for serial communicationwith 89C51. the program is found to b correct. when i checked the program for led blinking the hadrware was perfectly working. but wen i tried sending letters there is no output from the hardware. i m transmitting through the serial port of my computer. do i hav any way to acess the sbuffer??? can u send me a program to do so??? pesase...waiting for ur reply...

    jasper
     
  16. virtualeye

    New Member

    Sep 1, 2006
    1
    0
    hello saha,
    i've just join your forum 'coz i like the work u r doing for us.i've a problem on interfacing the 93c46 EEPROM with th 89c51 can u help me in programming of that.I've also the code for 93CS46 got from that site i.e http://www.pjrc.com/tech/8051/serial-eeprom.html, so i need a help for change this code according to 93C46.
     
  17. aziejal

    New Member

    Sep 6, 2006
    3
    0
    hai Saha, nice to meet you here.. as hohozai mentioned on 24-7-2006, he is doing an assignment.. apparently, my assignment is almost the same as him.. so, could u please send me the solution that u gave him so that I can modify it a little bit.. thanks in advance, waiting to hear from u. :)
     
  18. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    HI hohozai,

    This is really a good game. As far as the programming is concerned it is much easier and not much of complexity is involved and i'll be guiding you throughout. first of all you've to decide how many levels you need. after that you need to store the sequence of keys stokes in the memory location for each level.One more thing is its better you connect an RS-232 cross cable to your MCU so that you can transmit some messages like "You've gone to the second level " and there is no need to program your MCU if you want to increase the number of levels and the sequence of keystokes per level.if you don't want to connect to your pc then you've to do some logic like. if the key 1 is pressed for 1 min continuously then it enters the set mode where by you can chage the keystokes by pressing the key in sequence. are you getting it???. i feel that the sound produced will come frm external ckts which will get activated by pressing the appropriate keys.that is pressing one key will give info to the mcu and also close the sound generating the circuit to produce the required sound. if you want me to write the whole program for you then i need the following details.

    1. 8 keys connected to which port
    2. i feel that it is better you connect the leds to the ports of MCU than the switch itself becoz you can on/off as and when the MCU wishes.
    3. let me know in which port you'll be connecting all the 8 leds.

    That's it. Don't worry i'll be woking on this and will let you know it by tomorrow. mean while reply me.ok...keep posting. i am much happy about this. i hereby ask everyone to throw there MCU related problems to this board and you'll get the answer soon. it's been since a long time since i'd posted. iam sorry for the delay. frm 2 day onwards i'll be viewing the post minimum twice a day morning and evening.
     
  19. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    HI maheshudr,

    I REMEMBER that www.sunrom.com- sunrom technologies are producing the programmer. in addition to selling they give the enitre schematic, firmware , software for interacting free of cost. if you want to do it then follow this link you'll find what you asked. it is really gud isn't it!.

    http://projects.sunrom.com/device-programmer-for-89-series-chips/#more-10

    sorry for the delay. here after i'll reply soon. within a day.

    regards,
    saha
     
  20. saha

    Thread Starter Well-Known Member

    Jun 1, 2006
    53
    0
    Hi aziejal,

    iam sorry to reply late. i've posted the reply for hohozai. you can add some masala like putiing an LCD display which gives some mesages like " start now " , " you've successfully passed level 2 ", and you can add some intelligence to it like the MCU itself will decide the levels and keep increasing the levels as the person crosses the highest available level. you see sky is the limit. if you're really passionate about it ,then we can go on. you write it in a detailed way like how the system should work. are u getting me. you tell me the logic how the mcu has to propagate. don't worry about the complexity of it i'll write the program and explain you with exhaustive comments. ok.by the way how familiar are you with 8051? can you identify port numbers, if not go through the datasheet and decide the circuit. if you need we can put some 16 keys and instead of sound we can have numbers from 0to 9, A,B,C,D,E,F. IF YOU NEED we can connect a PC keyboard and enter the alpha numerals. visit www.beyondlogic.org for interfacing with computer keyboard. i may be giving you a broad idea, but you put the constraint on your own, like 16 keys, LCD display and MCU only. Then we can do wonders. will be back soon. if possible attach the ckt or send it to sahana.sankar@rediffmail.com. write as much clealy as possible regarding the logic of operation.

    regards,

    saha
     
Loading...
Thread Status:
Not open for further replies.