Hello Richard,

Usually startup is just some loading of SFRs which is just as easily
written in C as in ASM with the same result. I brought this up because the
O/P mentioned an external RAM. I don't know if the default also enables
the EXTERNAL memory interface and with what timing. I also don't know if
the watchdog is enabled by default. This can all be handled in
_sdcc_external_startup().

I too find the 'page mode' a confusing term. But this was not what I was
getting at when I mentioned MPAGE/XPAGE/other. A genuine 8051 has only one
DPTR and can use P2 to set the high-byte of an address when using MOVX @Ri
instructions. SDCC uses this during initialization (crtxinit.asm) to copy
from code memory (using dptr) to xdata (using r0). Some new derivatives
have internal xram and setting P2 does not affect the address high-byte.
Instead some have another sfr (MPAGE/XPAGE/EMI0CN/whatever) to set the
'page'. As was to be expected every manufacturer chooses a different name
and sfr-location. That is why SDCC uses _XPAGE which defaults to alias P2,
but can be overridden to any other sfr location. Many derivatives with two
DPTRs do not have such an sfr and thus MOVX @Ri can only access
0x0000-0x00FF. In crtxinit.asm is also an implementation that uses two
DPTRs (without auto-inc/auto-toggle) to do the initialization, but it
needs to be enabled.

Hope this clears things up a bit better.
Maarten


> Maarten,
>
> The DS89C4x0's do indeed have an SFR that enables the 1kB internal XRAM
> which CAN, indeed, be mapped into code space,  as well as one that
> enables the memory map to be modified under firmware control, and a
> couple of others for changing the address multiplexing mode and the
> clock multiplier, as well as enabling the second and changing the
> operating modes of both data pointers.  I'm not sure that any
> 89C4x0-family-specific treatment is required, as the mode in which the
> MCU "wakes up" from reset is well-defined and one has to manage the
> changes in those configurations with the utmost care, as it can cause
> the program to "get lost" if one changes the page mode or the clock
> rate "on the fly" and therefore probably should be handled in ASM.
>
> I feel the choice of the term "page mode" for the two additional address
> multiplexing schemes was very unfortunate, as it has nothing at all to do
> with memory paging, of which this family is no more capable than the
> standard 805x's and simply serves to confuse some users.
>
> As you probably know from the 8052 discussions, I'm not a big fan of
> HLL's for small (<1E5 lines) tasks as might be handled with small micros.
> However, I follow this group because I'd use SDCC if I were to decide it
> appropriate.
>
> regards,
>
> Richard Erlacher
>
> ----- Original Message -----
> From: "Maarten Brock" <[EMAIL PROTECTED]>
> To: <sdcc-user@lists.sourceforge.net>
> Sent: Monday, April 21, 2008 2:58 AM
> Subject: Re: [Sdcc-user] SDCC with DS89C450
>
>
>> Hi Matthew,
>>
>> As far as I know the DS89C450 is a mcs51 derivative with the normal 64k
>> limits and no special bios like the ds390 or ds400. The use of
>> --xram-size
>> is what you need, and maybe you also need --xram-loc.
>>
>> Also make sure to implement a custom _sdcc_external_startup() which sets
>> up the (external) memory interface and maybe the watchdog. This function
>> is executed before initialization takes place.
>>
>> You probably also need to change crtxinit.asm to use the dual DPTR as it
>> seems this MCU has no MPAGE, XPAGE or whatever others might call the sfr
>> to access more than 256 bytes with MOVX @Ri.
>>
>> For the header file look in AN3477:
>> http://www.maxim-ic.com/appnotes.cfm/an_pk/3477
>>
>> Greets,
>> Maarten
>>
>>> Hi
>>>
>>> I tried to ask this question on the Dallas discussion board as it
>>> seemed
>>> the most relevant place, but it appears to be broken.  (And running
>>> like
>>> it's connected to the Internet via a 2400bps modem.)
>>>
>>> So - what I would like to know are the following two things:
>>>
>>> 1) Which is the correct target (ds390/ds400/etc.) for this device?
>>>
>>> 2) I am providing 32kB of external RAM and want to tell SDCC that this
>>> is as much as it is getting.  The SDCC documentation (PDF from
>>> SourceForge) suggests to me that I should use --xram-size to specify
>>> this for mcs51, but does this apply to all targets?
>>>
>>> Cheers
>>>
>>> M
>>>
>>> --
>>> Matthew Smith
>>> Smiffytech - Technology Consulting & Web Application Development
>>> Business: http://www.smiffytech.com/
>>> Personal: http://www.smiffysplace.com/
>>> LinkedIn: http://www.linkedin.com/in/smiffy
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>>> Don't miss this year's exciting event. There's still time to save $100.
>>> Use priority code J8TL2D2.
>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>>> _______________________________________________
>>> Sdcc-user mailing list
>>> Sdcc-user@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>>>
>>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>> Don't miss this year's exciting event. There's still time to save $100.
>> Use priority code J8TL2D2.
>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
>> _______________________________________________
>> Sdcc-user mailing list
>> Sdcc-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
>


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to