serial communication for AVR microcontroller
Thu Mar 13 2008, 10:27 am
we are working on project controlling of stepper motor through AVR microcontroller using serial communication.in that as a part of testing we are to transmit any one bit data and receive same bit.we are using AVR STUDIO4 software.pls guide us with instruction of serial communication as soon as possible
Thu Mar 13 2008, 04:45 pm
we have already gone through it and we made program by reffering that but it is not working for transmitting and receiving a bipls,send proper program for that.
Mon Mar 17 2008, 03:37 pm
actualy we have to send and recieve a bit through port D of AT MEGA32 i.e on port D.0 and port D.1 we are not getting wat to do for program how to write.pls guide
Mon Mar 17 2008, 11:43 pm
why D.0 and D.1 ?? you can do it on any pin... just send them/ receive serially
Tue Mar 18 2008, 10:51 am
Here is our program.pls check it and make the necessary changes.
.include"m32def.inc" .def reg1= r16 .def reg2=r17 .def reg3=r18 .def reg4=r19 Serial_Init: ldi reg1,00 out UBRRH,reg1 LDI reg1,25 OUT UBRRL,reg1 ldi reg4,( 1<<RXEN)|(1<<TXEN) out UCSRB,reg4 //ldi reg1,00 ldi reg1,(1<<URSEL)+(1<<USBS)+(3<<UCSZ0) OUT UCSRC,reg1 //sbi UCSRA,RXC USART_Transmit: sbis UCSRA,UDRE rjmp USART_Transmit ldi reg1,0XFF out UDR,reg1 sbi UCSRA,TXC USART_Receive: sbis UCSRA,RXC rjmp USART_Receive in reg3,UDR out PORTA,reg3 ret
[ Edited Tue Mar 25 2008, 12:11 pm ]
Powered by e107 Forum System