nofnof
Junior Member level 3
- Joined
- Mar 2, 2005
- Messages
- 31
- Helped
- 3
- Reputation
- 6
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,614
atmega8515 usart asm
how can i send data to ATmega8515 using Hyperterminal , i have connected the microcontroller to a MAX232 and the pc with the max232 using a serial RS232 cable
i've connected them as the graph in the attachmnt , and i have programmed the microcontroller with this program before conneting it with max232 and hyperteminal
the program :
;***************************************************************************
;* File Name :uart.asm
;* Title :UART based RS232 communication
;* Target MCU :AT90S8515
;*
;* DESCRIPTION
;* Test the UART based RS232 communication
;***************************************************************************
;***** Directives
.device atmega8515
.nolist
.include "m8515def.inc"
.list
.def temp = r16
;***** Interrupt vector table
rjmp RESET ; Reset handle
reti ; External Interrupt0 handle
reti ; External Interrupt1 handle
reti ; T/C1 Capture Event Interrupt handle
reti ; T/C1 CompareA Interrupt handle
reti ; T/C1 CompareB Interrupt handle
reti ; T/C1 Overflow Interrupt handle
reti ; T/C0 Overflow Interrupt handle
reti ; SPI Transfer Complete Interrupt handle
reti ; UART Rx Complete Interrupt handle
reti ; UART Data Register Empty Interrupt handle
reti ; UART Tx Complete Interrupt handle
reti ; Analog Comparator Interrupt handle
;***** Subroutines
uart_init:
sbi UCSRB, RXEN ; Rx Enable
LDI R18,$80
OUT UCSRC,R18
LDI R18,$86
OUT UCSRC,R18
LDI R18,$06
OUT UCSRC,R18
ldi temp, 51 ; Baudrate 9600 @ 8MHz Clock
out UBRRl, temp
ldi r18, $00
out UBRRH, R18
ret
getc:
IN TEMP, UDR
OUT PORTA, TEMP
ret
;***** Main
RESET:
ldi temp, LOW(RAMEND)
out SPL, temp ; Initialize SPL
ldi temp, HIGH(RAMEND)
out SPH, temp ; Initialize SPH
rcall uart_init ; Initialize UART
loop:sbis UCSRA, RXC ; Wait for character
rjmp loop
rcall getc ; Read character from RS232
rjmp loop ; Repeat endless
is this correct ???
ive send data and theres no response !
how can i send data to ATmega8515 using Hyperterminal , i have connected the microcontroller to a MAX232 and the pc with the max232 using a serial RS232 cable
i've connected them as the graph in the attachmnt , and i have programmed the microcontroller with this program before conneting it with max232 and hyperteminal
the program :
;***************************************************************************
;* File Name :uart.asm
;* Title :UART based RS232 communication
;* Target MCU :AT90S8515
;*
;* DESCRIPTION
;* Test the UART based RS232 communication
;***************************************************************************
;***** Directives
.device atmega8515
.nolist
.include "m8515def.inc"
.list
.def temp = r16
;***** Interrupt vector table
rjmp RESET ; Reset handle
reti ; External Interrupt0 handle
reti ; External Interrupt1 handle
reti ; T/C1 Capture Event Interrupt handle
reti ; T/C1 CompareA Interrupt handle
reti ; T/C1 CompareB Interrupt handle
reti ; T/C1 Overflow Interrupt handle
reti ; T/C0 Overflow Interrupt handle
reti ; SPI Transfer Complete Interrupt handle
reti ; UART Rx Complete Interrupt handle
reti ; UART Data Register Empty Interrupt handle
reti ; UART Tx Complete Interrupt handle
reti ; Analog Comparator Interrupt handle
;***** Subroutines
uart_init:
sbi UCSRB, RXEN ; Rx Enable
LDI R18,$80
OUT UCSRC,R18
LDI R18,$86
OUT UCSRC,R18
LDI R18,$06
OUT UCSRC,R18
ldi temp, 51 ; Baudrate 9600 @ 8MHz Clock
out UBRRl, temp
ldi r18, $00
out UBRRH, R18
ret
getc:
IN TEMP, UDR
OUT PORTA, TEMP
ret
;***** Main
RESET:
ldi temp, LOW(RAMEND)
out SPL, temp ; Initialize SPL
ldi temp, HIGH(RAMEND)
out SPH, temp ; Initialize SPH
rcall uart_init ; Initialize UART
loop:sbis UCSRA, RXC ; Wait for character
rjmp loop
rcall getc ; Read character from RS232
rjmp loop ; Repeat endless
is this correct ???
ive send data and theres no response !