I found this code to control a cellphone with AT commands, but the tutorial used Assembly on a PIC micro controller and I got a modern device RBBB arduino clone. I was wondering if anyone could go through the code and tell me what the lines do so that I could re-write it in an Arduino sketch.
;****define registers***** STATUS equ 03h TXREG equ 19h TXSTA equ 98h SPBRG equ 99h RCSTA equ 18h TRISC equ 87h CounterL equ 20h CounterH equ 21h ;******init****** bsf STATUS,5;to bank 1 movlw b'00000001' movwf TRISC movlw b'00100110' movwf TXSTA movlw b'00011001' movwf SPBRG bcf STATUS,5 movlw b'10010000' movwf RCSTA ;*****start Tx***** main movlw "A" movwf TXREG call delay call delay call delay movlw "T" movwf TXREG call delay call delay call delay ; Here put the characters in the AT command you want to give to the phone as given above one by one. First the character "A"...then "T"...then characters of your commands. The RXREG do the conversion of the character into the ASCII code. You don't have to worry about it. delay decfsz CounterL,1 goto delay decfsz CounterH,1 goto delay return end