??? 03/06/07 18:07 Read: times |
#134396 - partial answers Responding to: ???'s previous message |
Eugene Yong said:
2. If i am to use ASM to send out a byte of data out from the TxD (P3.1) to a modem.For e.g : i want to send the character "A" to a modem, does the command needed to be sent this looks like this? MOV SBUF, #A euuh, no.... MOV SBUF, #'A' or MOV SBUF,#41H would be more appropriate, and don't forget to initialise your UART properly If yes, how does the C Code counterpart of this line looks like? I can't think of it no matter how hard i tried, i already even googled for few hours but it's no avail. 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) 3. If i were able to send out a byte of character successfully to the modem, let's advance the problem to next stage. This time i need to send a string of command to the modem to instruct it to dial a number instead of a single character. For e.g : "ATD1234567" where 1234567 is the telephone number. Can i use the similiar line: MOV SBUF, #ATD1234567 ? 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. That is all i need to know for now to kick off with my coding. I don't think so :-) You will need to get some basics first.. Read the tutorials on this site. regards Patrick |