any ideas on how i can write a code to transmit an AT command from 8051 to zigbee serially? thanks in advance
Have you not heard of loops ??
If not, then you really need to get (back) to that basic textbook!