please give me hardware diagram & assembly code.
"give me hardware diagram & assembly code"
Isn't there an Atmel Application Note that does exactly that?
Or try http://www.keil.com/condb/