From: <r.g...@vi...> - 2007-09-07 10:01:53
|
Hi Feusag, thanks for fast response! I changed init usart routine as You recomended, but I'm not shure that understand You right! Can You send complete routine to me? thanx, Robert > > Od: "Feusag Mhor" <feu...@go...> > Datum: 2007/09/05 sri PM 06:22:08 GMT+01:00 > Za: amf...@li... > Naslov: Re: [Amforth-devel] mega8 installation problem > > Hi, > > I had the same problem and traced it to the baud rate calculation. > > It turns out that there is a 7% error at 9600 baud with a 1MHz system clock > (see table 60 in the datasheet) and this is out of spec for you PC UART to > read. > > I changed the baud rate on line 22 of template.asm to 4800 (0.2% error) and > everything was OK. > > I have also prototyped the following change to armforth/words/usart.asm to > use the U2X double speed mechanism. > With this change the error at 9600 baud is 0.2% with a 1MHz clock and works > perfectly. > > Index: usart.asm > ================================================================== = > --- usart.asm (.../vendor/amforth/2.3/words/usart.asm) > +++ usart.asm (.../trunk/forth/amforth/words/usart.asm) > @@ -81,7 +81,7 @@ > .dw XT_D2SLASH > .dw XT_D2SLASH > .dw XT_D2SLASH > - .dw XT_D2SLASH > +; .dw XT_D2SLASH ; We are going for 2X, so > remove one of these... > .dw XT_ROT > .dw XT_UMSLASHMOD > .dw XT_SWAP > @@ -96,7 +96,14 @@ > .dw XT_DOLITERAL > .dw BAUDRATE0_HIGH > .dw XT_CSTORE > + > .dw XT_DOLITERAL > + .dw $02 ; U2X > + .dw XT_DOLITERAL > + .dw $2B ; UCSRA > + .dw XT_CSTORE > + > + .dw XT_DOLITERAL > .dw (1<<UMSEL01)|(3<<UCSZ00) > .dw XT_DOLITERAL > .dw USART0_C > > > > I hope this helps. > > Cheers > > Feusag > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > |