Menu

#438 Zilog Z51F3220 H-File/Support.

open
None
3
2022-10-05
2022-09-10
Dj
No

Hi all,

for my usage I created .h file for the named uC. Informations cross-checked with uC specification, nevertheless a review would be appreciated.

I would be glad to see it included in the SDCC.

If I understood correctly, no other files will be necessary since mcs51.lib is covering this controller.

Please reassign this ticket as seen fit (prio and owner).

2 Attachments

Discussion

  • Maarten Brock

    Maarten Brock - 2022-09-12

    Thanks for the patch.

    But please don't assign Owner and Priority.

    From the datasheet it seems that the MOVX @Ri instructions can only access xram 0x0000-0x00FF and that there is no _XPAGE like register. This means that you will have to use a rebuilt crtxinit.asm with DUAL_DPTR set. Though not a perfect place, maybe it's best to add this warning at the top of this header file. You will also have to add an sfr DPS to overlap EO. And you may want to move _XPAGE to a safe dummy address. See crtx*.asm in https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/device/lib/mcs51/ and also the SDCC manual.

    And while you're at it, please replace all TAB's with spaces.

    Maarten

     
    • Dj

      Dj - 2022-09-28

      Hi Maarten,

      no prob, will keep Owner and Prio open next time.

      I have a couple of questions, just to confirm if I understood correctly.

      1) only crtxinit.asm needs DUAL_DPTR 1, as I found it nowhere else in other crtx*.asm?
      2) would SFR(EO , 0xA2); SFR(DPS , 0xA2); be sufficient?
      3) can I assign SFR(_XPAGE, 0x02FF) since 0x02FF is unused?

      Yup, TABs I will clean up.

      P.S. Took me a while until I came back to the topic.

       

      Last edit: Dj 2022-09-28
  • Dj

    Dj - 2022-09-28

    How about now?

     
  • Maarten Brock

    Maarten Brock - 2022-10-05

    When I suggested to replace TABs with spaces I did not mean to make a mess of the alignment ;-)

    Re 1) Yes, that's the only one.
    Re 2) That looks sufficient to me.
    Re 3) 0x02FF is way out of bounds for an SFR address. Maybe 0xF9 is usable provided writing there doesn't have any side effects.

    Further remarks:
    4) What is the x in Z51F3220x ? Remove it.
    5) How about this warning:

    #ifndef DUAL_DPTR
    #warning Make sure to make a copy of SDCC's .../mcs51/crtxinit.asm, modifiy it to use DUAL_DPTR = 1, and assemble it with "sdas8051 -plosgff crtxinit.asm"
    #endif
    

    This way any unsuspecting user gets to see the warning and it can be suppressed when it is properly handled.

    Maarten

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.