From: Eeyore on 5 Sep 2008 13:35 Rich Grise 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 ? > > It's way, way, easier to use than the 8051's simple little counter. At > least I found it to be so. I've done 8051 (8035 + eprom, actually) and > 68HC11, and the 68HC11 makes the 8051 look like a boat anchor. ;-) Can you give an example of how it's easier ? Graham
From: Eeyore on 5 Sep 2008 13:39 MooseFET wrote: > I think two causes are most likely: > > (1) > Something isn't being initialized. Now why does my code always start with an initialisation procedure for variables and the 8051 special function registers function I wonder ? Interesting point. Atmel occasionally add extra functions in the SFRs over vanilla 8051s but I'd have thought they'd do something about telling you. Graham
From: Rich Grise on 5 Sep 2008 17:25 On Fri, 05 Sep 2008 18:35:53 +0100, Eeyore wrote: > Rich Grise 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 ? >> >> It's way, way, easier to use than the 8051's simple little counter. At >> least I found it to be so. I've done 8051 (8035 + eprom, actually) and >> 68HC11, and the 68HC11 makes the 8051 look like a boat anchor. ;-) > > Can you give an example of how it's easier ? I was kinda hoping you're familiar with the respective architectures. The 8051 has one counter - set it, let it time out, and there's your interval. ONE time interval per event; then you have to reset it for the next one, and so on. The HC11 (and others by Moto) have a free-running counter (sunc to the clock, of course) and you set "timer compare" registers, which toggle the output and trigger an interrupt when the counter reaches that value; I'm not sure how many of these timer compare register it has, but there are at least two that I know of, and with a little bit of cleverness, you can manipulate the registers in the ISR, and have an almost arbitrary number of events as long as your ISR is quick enough to not block other interrupts. The "timer capture" input just responds to the timer input by writing the current value to the timer capture register, which then your ISR can use at its leisure. ;-) Hope This Helps! Rich
From: Rich Grise on 5 Sep 2008 17:30 On Fri, 05 Sep 2008 17:53:59 +0100, 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? But I've never trusted "sleep mode" - probably because it takes me about 3 hours after getting up, before I'm fully awake. ;-) Do you have a little "morning eye-opener" circuit? ;-D Good Luck! Rich
From: Joerg on 5 Sep 2008 17:42
Rich Grise wrote: > On Fri, 05 Sep 2008 17:53:59 +0100, 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? > This is done all the time. First time I used the PCON features on a 88C51 was in the early 90's. You have to make sure it does a controlled wake up (socks, shoes, brush teeth, etc.) and know the time it takes. When you build analog/RF stuff where there needs to be radio silence you've got no other choice. > But I've never trusted "sleep mode" - probably because it takes me about > 3 hours after getting up, before I'm fully awake. ;-) > > Do you have a little "morning eye-opener" circuit? ;-D > Back in the army one guy's eye opener circuit consisted of a serious stash of booze in the locker. Beats me how he evaded detection by the drill sergeant. By lunchtime you couldn't light a cigarette near the guy or there would have been an explosion. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM. |