MC68HC11P2 Clearing the EEPROM

Discussion in 'Programmer's Corner' started by gnosnibor, May 11, 2014.

  1. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Hi all, I haven't much recent experience of programming MPU's but i have a bit of spare time these days & have started playing around with these MPU's for fun. Do i need the MPU to be into Bootstrap Mode to clear the eeprom contents ? I am hoping someone will be able to advise me on how to access & clear the eeprom on the MC68HC11P2.

    The MPU is part of a control unit & I can't remove the chip so i am trying to do this by hard wiring the power/mod a/b reset pins etc to a RS232-TTL circuit (rest of power to board is off). When i do a reset the MPU echoes back a single '0' character to a terminal program but if i use a PC based bootloader program to acess the chip it just returns a comms error which i find strange as i get a character '0' echoed back after every reset ?
    Is the '0' character a correct response from a MPU thats been reset & placed in Bootstrap mode ?

    Hope some of this makes sense to someone out there & thanks for reading.

    Graham
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    You need to tell us the full part number of the MC68HC11P2.
    i.e. what letters come after the P2?

    The MC68HC11P2 has no EEPROM. The ROM cannot be erased.
     
  3. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Hi MrChips, thank you for the response.

    I believe the numbers are:

    MC68HC711P2CFN4-1E53M

    Even if this chip doesn't have EEPROM (it certainly doesn't have an external EPROM) can you tell me if the response from the MPU AFTER reset is correct (character '0' received) ?

    I have scoped the TX line of the chip & when the chip is RESET i see it pulse once (the 0) & then when any bootloader s/ware talks to it it never responds back (MODA & MODB & IRQ held low)

    Regards
    Graham

    Now i'm confused MrChips as the datasheet i have for the chip says it has 640 bytes of EEPROM
    http://pdf1.alldatasheet.com/datasheet-pdf/view/93774/MOTOROLA/MC68HC11P2.html
     
    Last edited: May 11, 2014
  4. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Thanks for telling us it is MC68HC711 instead of MC68HC11.

    That makes a huge difference. The HC711 has EEPROM.
    I can show you how to erase and program it.
    What IDE package are you using?
     
  5. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    I haven't tried any actual programming on it so far , all i want to do at the moment is learn how to clear the eeprom. The only packages i have used are freeware bootloader packages such as PCBUG11 on an old DOS laptop but using them i get the comms error messages.

    My background is analogue electronics & i am familiar with RS232 etc so i am confident the RS232/TTL converter i have is working ok, just the chip doesn't seem to communicate after the initial reset. (still dont know if that character echoed back is correct)

    Last time i did any programming on an MPU was a looooong time ago (6502's (anyone remember them or even heard of them :) ) ?

    What IDE do you think i should use to read/clear the EEPROM in your opinion ?

    Regards
    Graham
     
  6. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Any advice appreciated. I seem to have blown the MPU i have been working on as the RESET pin is permanently reading 0.6ohms to ground meaning its in permanent reset.I have no idea how that has happened ,luckily i have another one to try with. :p
     
  7. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    It's been a long time since I last worked with HC11 but it is a very nice chip to play with. I will have to dig up my notes to see how the bootloader works.
     
  8. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Well the way in am understanding it is that the MODA & MODB pins must be tied to ground & the IRQ pulled high. After reset the MPU is then in BOOTSTRAP mode (I think it send a character to the terminal program & it then waits for 256 bytes to be received after which it transfers control to the downloaded program.

    I'm not sure if i need to open MODA/MODB after reset or leave them closed & grounded. Also once the program has been downloaded how do i then go about accessing/clearing the EEPROM ?

    Regards
    Graham
     
  9. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    I'm trying to refresh my memory on how the bootstrap mechanism works.
    As far as I can see, connect MODA and MODB to GND.

    Send $FF to establish the baud.

    Next send 256 bytes and start executing at $0000. Your code contains the mechanism for reading data and writing to EEPROM. You will need +12V on VPPE to program the EEPROM.

    There is also a resident utility at $BF00 which you can use to program the EEPROM.

    All the information is in the User Manual (pdf).

    If I remember correctly, there was a flaw in some HC711 chips. You need to put a current limiting resistor in series with VPPE. I will have to look this up for you. If you ignore this, you risk destroying the chip.
     
    Last edited: May 13, 2014
    absf likes this.
  10. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    I checked into this.

    http://cache.freescale.com/files/microcontrollers/doc/errata/68HC711E9MSE3.pdf

    When Motorola (now Freescale) shrank the die size around the year 1999, they experienced some parasitic problems with the VPPE programming circuitry. The result was destroyed chips. (I have destroyed a number of them myself).

    This applies to MC68HC711E9 with mask set H50W (identified by 3J74Y, for example).

    This may not apply to you since your chip is MC68HC711E2.
    It doesn't hurt for you to apply the workaround.

    The simple solution is to put a 1kΩ resistor between 12V and VPPE.
    (I have used 100Ω successfully).
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    I should point out that all HC711 parts have one-time programmable ROM (OTPROM).
    You cannot erase the ROM once it has been programmed.

    The MC68HC711P2CFN4 has 32kB of OTPROM, 1kB of RAM and 640 bytes of EEPROM.
     
  12. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Thanks for your help MrChips.

    I am just connecting up another MPU to replace the one that went short on the reset line. As its already soldered into the board i tried using a PLCC84 chip socket placed upside down on the MPU to make contact (so as not to have to solder direct onto the chip pins) but it's not a good enough contact so soldering direct again at the moment. The Freescale user manual is very useful, i will try the built in routine to access the eeprom if i ever get it to respond to me.

    What i would like to do is dump the contents of the eeprom to a file & then clear the eeprom completely.

    Will post back on how i get along

    Graham
     
  13. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Dont know where i'm going wrong here but just can't get this chip to talk .

    Set up i have is:

    MODA & MODB to gnd (via 2 dip switches)

    The VDD pin (Supply) is isolated from the rest of the board & has 5 volts on it

    The VSS (Ground) is connected to ground (i can open the ground via DIP switch if needed

    RESET is connected to a pullup resistor feeding a 1uf cap & this is pulled low by a small microswitch . (when that happens i now get TX & RX lights blinking once !

    I am using the onboard XTAL which i am assuming is 8Mhz (its not marked as such though & its just a small plastic chip marked 614Y

    RX & TX of course connect to a small TTL/RS232 converter which uses a MAX232 & was purchased off Ebay. I have proed its working by doing a loop test with a terminal prog.

    That is basically it,no other connections , do i need to pull any other pins high or low ?

    I haven't connected the XIRQ/VPPE pin at all yet so its just floating i guess.

    When i fire up PCBUG11 on my old dos machine i start it wil the run line PCBUG11 -A PORT=1

    I then see the LED blink on the converter as it sends data to the chip but then PCBUG11 drops out with REGISTER READ TERMINATED - GENERAL COMMS FAULT. The chip never responds

    Have i missed some pin that needs pulling high/low ?

    I iwll scope the xtal tomorrow see if i can read the frequency

    Any help appreciated.

    Graham
     
  14. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Thinking of giving this up as a bad job.Just popped a 2nd chip with same problem as before, the RESET line is being killed,now reads almost short to ground as with the first one &that drags down the PSU.Why i have no idea

    Graham
     
  15. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    I don't have the same chip as you do but I have some MC68HC811E2FN and MC68HC711E9CFN2 in 52-pin PLCC packages.

    I can try these and see how they are supposed to behave as per your tests.
     
  16. gnosnibor

    Thread Starter New Member

    Mar 27, 2012
    9
    0
    Hi MrChips

    I think it's because these chips are already embedded into a board but what worries me more at the moment is why the RESET pin keeps going short. I used a similar setup to that in the datasheets for the RESET line but thats 2 chips now that are dead. I was thinking of ordering a chip tonight & like you said testing as a stand alone chip to see how it responds, at least that way i will be able to prove the software/interface etc.

    Graham
     
  17. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    Some HC11 chips have a Buffalo program built in. This is a program that allows you to monitor the state of the chip and will allow you to program it.
     
Loading...