![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| i got this code from a site, but i cant assemble it in keil which assembler whould i use?? or is there some fault with the code itself?? the '*' are giving some problem "djnz r1,*" for instance TXD EQU P1.0 Transmit on this pin RXD EQU P1.1 Receive on this pin * The serial baud rate is determined by the processor crystal, and * this constant which is calculated as: (((crystal/baud)/12) - 5) / 2 BITTIM EQU 45 (((11059200/9600)/12) - 5) / 2 * * Transmit character in A via TXD line * putc CLR TXD Drop line for start bit MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For START bit MOV R1,#8 Send 8 bits putc1 RRC A Move next bit into carry MOV TXD,C Write next bit MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For DATA bit DJNZ R1,putc1 write 8 bits SETB TXD Set line high RRC A Restore ACC contents MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For STOP bit RET * * Receive a character from the RXD line and return in A * getc JB RXD,* Wait for start bit MOV R0,#BITTIM/2 Wait 1/2 bit-time DJNZ R0,* To sample in middle JB RXD,getc Insure valid MOV R1,#8 Read 8 bits getc1 MOV R0,#BITTIM Wait full bit-time DJNZ R0,* For DATA bit MOV C,RXD Read bit RRC A Shift it into ACC DJNZ R1,getc1 read 8 bits RET go home is this workable?? | |
| |
| | (permalink) |
| I Suppose this code is for a 8051 Micro controller, right? a simple question, why don't you use the hardware UART.. ? | |
| |
| | (permalink) | |
| Quote:
You've not being paying attention, he has another thread asking about dual UART's. | ||
| |
| | (permalink) |
| the hardware uart is already being used am interfacing a rfid reader and my pc to the controller i need an extra serial port... i knw there are controllers available with 2 uarts, but i cant find them here...in my city... so..?? which assembler should i use??? i think djnz r1,* means as long as r1 is not zero, keep on looping?? right?? keil assembler is not assembling NOW Nigel...some help?? | |
| |
| | (permalink) | |
| Quote:
http://www.winpicprog.co.uk/pic_tutorial7.htm | ||
| |
| | (permalink) |
| there has to be someone on this site...good in 89c51 assemble ?? wake up ppl...help me out!!! | |
| |
| | (permalink) | |
| Quote:
It only seems to be used out India/Pakistan way?. | ||
| |
| | (permalink) |
| lol yeh...or they might be afraid to come out and show that they know something abt 89c51...they'll be ridiculed at yeh...am not sure abt india, but in pakistan latest ics are not available..somethin to do with import restrictions on electronics equipments we get the used ones and old ones :s i couldnt find a single controller with 2 uarts here :S no fair!!! | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Why does'nt it work!!!!!(dual uart) | tkvenki | Micro Controllers | 1 | 18th February 2008 06:06 AM |
| CNC software for PCB drilling | 3v0 | General Electronics Chat | 5 | 28th February 2007 11:14 PM |
| UART Message Display Softwares | Gayan Soyza | Micro Controllers | 6 | 7th February 2007 06:44 AM |
| Breadboard design software? | ThermalRunaway | General Electronics Chat | 10 | 24th July 2005 01:35 PM |
| software uart | edrich | Micro Controllers | 3 | 12th July 2004 06:44 AM |