From: mpm on 6 Sep 2008 23:49 On Sep 6, 10:56�pm, Spehro Pefhany <speffS...(a)interlogDOTyou.knowwhat> wrote: > On Fri, 05 Sep 2008 18:23:00 +0100, the renowned Eeyore > > > > > > <rabbitsfriendsandrelati...(a)hotmail.com> wrote: > > >Spehro Pefhany wrote: > > >> Eeyore wrote: > >> >Rich Grise wrote: > > >> >> If I could get an 8051 equivalent but with Motorola's timer system (see > >> >> 68HC11, e.g.), I'd be in hog heaven. ;-) > > >> >What's so great about Motorola's timers ? > > >> Much better designed. > > >In any specific way ? The only thing I might like in 8051 family timers is more > >than 16 bits. > > >Graham > > For example, they added a little clump of hardware that latches the > low order �byte of a timer in a hidden register when you read the high > order byte... which effectively makes a 16-bit timer read an atomic > operation on an 8-bit processor, without ugly tests and fixes. > > Best regards, > Spehro Pefhany > -- > "it's the network..." � � � � � � � � � � � � �"The Journey is the reward" > sp...(a)interlog.com � � � � � � Info for manufacturers:http://www.trexon.com > Embedded software/hardware/analog �Info for designers: �http://www.speff.com- Hide quoted text - > > - Show quoted text - Like they say, "A little bit goes a long way." Sorry, I could not help myself. ;-) I agree that using assembler to generate long delays at reasonably fast clock rates is a bit of a hassle. A wider clock register on 8051's would be nice, but is of course, not essential. -mpm
From: Eeyore on 7 Sep 2008 01:32 MooseFET wrote: > Eeyore wrote: > > MooseFET wrote: > > > Rich Grise <r...(a)example.net> wrote: > > > > TT_Man wrote: > > > > > >> > > > > >>> >> I think he said it was all written in asssembler <yuk>. > > > > > > >>> > On an 8051, asm is really the way to go. The OP was making comments > > > > >>> > about DPTR so I suspected asm but vagueness of his descriptions > > > > >>> > sounded like a C programmer who doesn't really know what is going on > > > > >>> > under the hood. Many C compilers overlay variables on the 8051 if he > > > > >>> > is doing interrupts in C code he may be running a routine in the > > > > >>> > interrupt code that overlays one of his variables. > > > > > > >>> Not a prayer in hell 100% assembler. :) > > > > > > >> Are you using interrupts? > > > > > Everything is interrupt driven. Processor spends 99% in sleep mode.Int > > > > > routines set flags and the background processes flags, then goes back to > > > > > sleep. Dual 3 of 5 uarts are processed with 125uS RTC. > > > > > > This raises a BIG red flag for me - how long does the uP take to come out > > > > of sleep mode? How's the interrupt latency? Did it used to block other > > > > interrupts, or could they be stepping on each other? > > > > > 8051s have a built in interrupt lock out and priority system. I doubt > > > that he is getting into multiple levels of interrupts. > > > > LOL ! > > > > All too easy by half and don't forget you have only 4 register banks to play > > with, meaning only only 3 simultaneous interrupts. of various priorities. > > Since the basic 8051 only has two levels, even if you use the faked up > 3rd level trick, you only have 3 interrupts to spread among the 3 > banks. It isn't really a problem. > > The faked up extra level involves calling a return from interrupt > instruction from within the interrupt code. This makes the following > code run in non-interrupt mode and thus allows another interrupt. > > If you try to do this more than one deep, you find your self in deep > trouble. Some of the more recent ones including I suspect the ED2 have more IP bits. Intel were smart to leave open those possibilities. Graham
From: Eeyore on 7 Sep 2008 01:35 MooseFET wrote: > Eeyore wrote: > > MooseFET wrote: > > > "TT_Man" <Some...(a)ntlworld.com> wrote: > > > > ">>>> >> I think he said it was all written in asssembler <yuk>. > > > > > > >> > On an 8051, asm is really the way to go. The OP was making comments > > > > >> > about DPTR so I suspected asm but vagueness of his descriptions > > > > >> > sounded like a C programmer who doesn't really know what is going on > > > > >> > under the hood. Many C compilers overlay variables on the 8051 if he > > > > >> > is doing interrupts in C code he may be running a routine in the > > > > >> > interrupt code that overlays one of his variables. > > > > > > >> >> Graham > > > > > > >> Not a prayer in hell 100% assembler. :) > > > > > > > Are you using interrupts? > > > > > > Everything is interrupt driven. Processor spends 99% in sleep mode.Int > > > > routines set flags and the background processes flags, then goes back to > > > > sleep. Dual 3 of 5 uarts are processed with 125uS RTC. > > > > > I think you need to look very carefully at the interrupt code to make > > > sure that it doesn't forget to save part of the context. This sounds > > > like it is either timing related or an uninitialized flag. > > > > Hmmm that's not how to code 8051 inrterrupts. > > Huh?????? > > Do you mean that you don't save the interrupted context???? !!!!! I can't remember my reason for saying that now. Flags perhaps ? Anyway PL/M handles all that for one. Declare procedure interrupt ! Graham
From: Eeyore on 7 Sep 2008 01:56 nospam wrote: > "TT_Man" <Someone(a)ntlworld.com> wrote: > > >> Only if this code was written by a competent engineer and you also > >> send money. I don't work for free. > > >>> ASM is for twits, the clueless, poor and morons mainly AFAICS. > >> > >> I guess this is where we will part company on this subject. > > > >Me too........ > > Funny, this week I spent two days porting 5000 lines of C from an 8051 to > a 16bit PIC. The PIC is vastly superior to an 89C51ED2 in almost every > respect including being less than half the price. > > If back in 1994 when I started on the first version of those 5000 lines I > had chosen to write in assembler I would be feeling a bit of a clueless > twit this week and probably for another month or two. I see no way anyone can write complex asm as fast as coding in an HLL. What's the cost of 'time to market' and lost sales when it makes the difference between being say the first out with the new widget and 3rd or 4th ? Graham
From: Eeyore on 7 Sep 2008 02:04
MooseFET wrote: > legg <l...(a)nospam.magma.ca> wrote: > > Eeyore wrote: > > >MooseFET wrote: > > > > >> Is it written in ASM or C? > > > > >I think he said it was all written in asssembler <yuk>. > > > > Can't think of a more apt instance where assembler shows it's > > advantages over more bloated forms - in troubleshooting IC abnormal > > behavior at a specific stage of operation. > > Not all compilers are all that bloated. PL/M doesn't do all that bad > of a job of making ASM out of a highish level source code. It makes > code that is better than most beginner level asm writers will produce. And since I will never be a full-time programmer it's (PL/M) just right for me. It's just so easy to use too. I was much amused at one point to be referred to as the company's 8051 / PL/M 'expert' with other engineers asking for my advice ! I coded an embedded control project in Pascal once. Because that's the only language the client's 'computer expert' knew. Getting the tools to support Pascal on a Z80 was a slight challenge. I think it came from Australia. Avocet Systems comes to mind. Graham |