??? 03/06/07 19:09 Read: times |
#134408 - Oh yeah, i forgot about that Responding to: ???'s previous message |
euuh, no.... MOV SBUF, #'A' or MOV SBUF,#41H would be more appropriate, and don't forget to initialise your UART properly Thank you for reminding me about the need of including '' between the character. I clearly remembered i read of this remember but i am not sure of the exact line. Just read the manual of your C-compiler. what about sfr at 0x99 SBUF; . . . SBUF='A'; or SBUF=0x41; again, don't forget to initialize (the above would be for the SDCC compiler) That was very helpful indeed as i now roughly know how to output a single byte data to the SBUF now. Sorry, i forgot to mention that I am using Keil uVision compiler and there is a reg51.h header to ease the programming for 8051 uC. Therefore, i think that there is no need to define the SFR of SBUF being at 0x99, am i wrong? What's your prior exposure to programming of microcontrollers? did you check on the definition of the MOV instruction? if so, how many bytes can the instruction be? How many bytes would "#ATD1234567" be? Even in 'C' we are talking low level, byte oriented stuff. uhm, actually i was thinking of #'ATD1234567' but now i have realized that only a byte can be sent to SBUF at any time, and the correct way would be by checking the TI flag and looping until the entire string of characters are sent. Please correct me if i am wrong. I have done some of programming in 8051 using ASM previously but i have not deal anything with serial communication yet let alone communication with modem, and this is the second time for me to code in C since it is easier for me to code the other more complex part of my project(which could be very cumbersome if i were to use ASM) I do know some or actually most of the basic of 8051, it is just that sometimes i might slipped and forget about things and needed to be reminded. It was 1 year ago since i last toy around with 8051 :) So please bear with me if i made any mistake in asking questions. Thank you very much again for such a prompt and positive response! |