Are you using an external crystal or internal RC Osc ? In case you are using RC to derive clock you might want to shift the value in UBRR +/- 2. On Sat, Apr 5, 2008 at 8:26 PM, Brian <blue_eagle74@yahoo.com> wrote: > I made a program in asm that kinda works. the only problem is when my > mega16 xmits to hyperterminal I get weird symbols. I am working with > 4Mhz 4800 baud. the letters in sram are in hex format. But the > symbols in HT look like they are from the extended ascII table. My > baud rate is set at 0x51. Has anyone else have a simliar problem? > > Brian > > .......... > main: > ldi ZH,high(message*2) ; Load high part of byte > address into ZH > ldi ZL,low(message*2) ; Load low part of byte > address into ZL > clr r0 ; > > menu: > lpm ; Load byte > from program memory into r0 > nop ; > nop ; > tst r0 ; Check if I > reached the end of the message > breq run ; If so, continue > mov treg, r0 ;xmit message > rcall txcomp ; > adiw ZL,1 ; Increase Z registers > rcall menu ; > ......... > message: > .db $50,$72 ; P ,r > .db $65,$73 ; e ,s > .db $73,$20 ; s ,SP > .db $61,$6E ; a ,n > .db $79,$20 ; y ,SP > .db $6B,$65 ; k ,e > .db $79,$20 ; y ,SP > .db $74,$6F ; t ,o > .db $20,$63 ; SP,c > .db $6F,$6E ; o ,n > .db $74,$69 ; t ,i > .db $6E,$75 ; n ,u > .db $65,$0A ; e ,LF > .db $0A,$0D ; LF,CR > .db $00,$00 ; END > > > -- Ranjit [Non-text portions of this message have been removed]
Message
Re: [AVR-Chat] comms problem
2008-04-06 by Ranjit Puri
Attachments
- No local attachments were found for this message.