From: Eeyore on 6 Sep 2008 03:04 JosephKK wrote: > It certainly is. Question: Are there any current electronic parts, > resistors, capacitors, inductors, diodes, transistors or ICs that have > been available for 40 years. BC 109 ? http://uk.farnell.com/9206787/semiconductors-discretes/product.us0?sku=multicomp-bc109 1N914 ? Graham
From: MooseFET on 6 Sep 2008 03:28 On Sep 6, 12:53 am, "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.
From: MooseFET on 6 Sep 2008 03:30 On Sep 6, 5:30 am, Rich Grise <r...(a)example.net> 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? 8051s have a built in interrupt lock out and priority system. I doubt that he is getting into multiple levels of interrupts. > > 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: MooseFET on 6 Sep 2008 03:34 On Sep 6, 1:30 am, Eeyore <rabbitsfriendsandrelati...(a)hotmail.com> wrote: > MooseFET wrote: > > Eeyore wrote: > > > MooseFET wrote: > > > > > Is it written in ASM or C? > > > > 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. > > I still use PL/M 51. So easy to use. You can treat it as highish level language and > set a register directly in the next line. > > I can't even begin to imagine coding some of the fairly complex (for microcontrollers) > stuff that we did with 8051s in asm. The mind boggles. Never mind code maintenance. I do it all the time. It takes less time to write the code than to design it. Any competent engineer can maintain it.
From: MooseFET on 6 Sep 2008 03:39
On Sep 6, 1:39 am, Eeyore <rabbitsfriendsandrelati...(a)hotmail.com> wrote: > 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 ? Mine usually starts: LJMP Startup .......................... StartUp: MOV SP,#MainStack MOV P1,#0FFH MOV P2,#0FFH MOV P3,#0FFH This way if you cause a jump back to zero in the debugging process, it is a lot more like a real reset. Setting the stack first is a good idea so you don't call anything before you do that. > > 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 |