We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
i need 2 uarts, one is hardware the other one is software
2 uarts microcontrollers are not readily available in my city
which assembler should i use to assemble it??
"i got this code from a site"
What site? Why aren't you asking this question at that site?!
"i cant assemble it in keil"
There is no standard assembler syntax - so that should come as no surprise!
"which assembler whould i use??"
If the code and/or the site fails to mention that absolutely essential and fundamental piece of inforation, you have to wonder what other essential details they have omitted from the code...
:-0
There are plenty of Software UARTs described all over the web; I'd not waste time with this one - carry on searching for one that is properly documented!
Are you sure that wasn't mentioned somewhere on the site?
After all, you managed to miss the instructions on this site about how to post source code - and they are pretty clearly stated:
www.danlhenry.com/.../keil_code.png
I was about to say Z80 from the djnz part - since you didn't formatted the posted code correctly, it is very hard to read...
It doesn't matter what assembler you should use for the specific code. If the code isn't for a processor you have, there is no use assembling it!
Note that a software UART isn't directly fast, and often doesn't work concurrently with other hardware since the timing requires you to turn off interrupts while bit-blitting.
Any web shop that can send you a suitable processor?
Check here: http://www.keil.com/dd/search_parm.asp
"Devices Found = 190" - can you really not find even one of them by mail order??