Cannot program to eeprom.

Just got my prop chip and am having a bit of a problem trying to program the eeprom with it.
the propeller tool keeps saying verify failed.
eeprom is 24LC128.
Using an FTD1232 chinese adapter which does work in programming the propeller to ram fine though when trying the full duplex serial test 2 spin program it writes garbage to the terminal.
did a modified connection to be able to enable the reset pin for the propeller chip by using a 0.1uF capacitor and a 4.7k ohms resistor and connecting Rx to DTR.
The eeprom is connected correctly and have A0 to A2 set to ground and SCL and SDA have pullup resistors.

Any help is appreciated.
«1

Comments

  • Welcome to the forum.

    Usually the P1 is just using 32K out of the eeprom, Most boards have now 64K eeproms, the second half just usable by your own software.

    I never used a 128K eeprom.

    Do you have a crystal connected? On bootup the P1 runs RCFAST from an internal oscillator. That is not precise enough for serial communication since the internal oscillator varies from chip to chip.

    I do not understand what you mean by 'and connecting Rx to DTR'.

    Can you maybe post a picture of your setup?

    Enjoy!

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • Dave HeinDave Hein Posts: 5,956
    edited 2019-01-10 - 00:17:47
    A 24LC128 is too small. It's only 16 Kbytes in size. The Prop requires 32 Kbytes or larger.
  • a shoot yes, its bits not bytes.

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • alatnetalatnet Posts: 76
    edited 2019-01-10 - 02:16:21
    Here's my setup.
    Red board is the FTD1232.
    Using a 20Mhz crystal, at least I think it's 20Mhz. Says 20 on it.
    3492 x 4656 - 4M
  • I thought the datasheet is very specific about the crystal and eeprom etc. The P1 normally takes a 5MHz crystal but you can go to 10 MHz And change the pll settings, but 20MHz cannot be used with the PLL. RTM takes 5 minutes whereas forum help turnaround is much longer then that. Why not RTM?

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • alatnetalatnet Posts: 76
    edited 2019-01-10 - 02:48:13
    looking at this site: https://lamestation.atlassian.net/wiki/spaces/SPIN/pages/17924229/CLKMODE
    i can use "xtal3+pll4" to set the clock mode to 80Mhz with a 20Mhz crystal.
    It's also listed in the datasheet on page 14.
    Though i dont have any other crystal atm, i did order 5Mhz crystals but it's going to take a while.

    As for eeprom, i thought the eeprom chip in the datasheet was a 128. So that one is on me. Did find some 512's on ebay, which i bought.
    Can probably use the 128 for extra storage or specific storage.
  • OK. Thanks.

    1) As @Dave Hein pointed out you need at least a 32Kb eeprom so 256Kbit not 128Kbit.
    2) A 20Mhz Chrystal will not work at all. You need 5Mhz for standard configuration of 80Mhz operating clock on the P1. You can use 6Mhz for 96Mhz clock, but that is seldom needed and might not work on a bread board anyways.
    3) you definitely need bypass capacitors on all power pins right next to the propeller chips power pins.

    These capacitors are very important, I fried the PLL on my first P1 because I left them off, to eager to wait, wanted to see it running.

    Parallax sells something called the PE-Kit, that is what I started with look for it in the Parallax shop and there you will find a basic minimal schematic for a bread board circuit. The PE Kit is some Starter pack with a assortment of resistors, leds, switches, all the stuff one need if one has nothing.

    You do not need to buy the Kit, you just find the documentation on the product page. Not sure if Parallax still sells it but before I started buying complete boards I got a couple of them, they also sold just a small bag with propeller and all needed Parts for something like $15.

    But be aware @alatnet that this forum and the Propeller are generally very addictive.

    Enjoy!

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • alatnetalatnet Posts: 76
    edited 2019-01-10 - 02:54:58
    This the PE Kit manual?
    https://www.parallax.com/sites/default/files/downloads/122-32305-PE-Kit-Labs-Fundamentals-Text-v1.2.pdf
    Also, page 5 of the datasheet is pretty much the same as the one in the PE Kit manual that i found on page 27.
    Though, im using the 3v3 power supply off of the FTD1232.
  • Yes, it is.

    And it is missing the caps too. That's bad. You basically need capacitors on both power inputs of the prop and you need to connect both power inputs. Capacitor from power to ground about 10pf ceramic if I remember correctly. Like the crystal right next to the pins.

    3.3V from FTD1232 is perfectly fine.

    Most sample programs use a 5Mhz Crystal and are running at 80Mhz. With 6Mhz you can get to 96Mhz and some boards are using 10Mhz Crystals. But 5Mhz is most common and that is what most demo programs except.

    Usually at the start of the main program you will find a line stating
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    

    this states that you have a 5Mhz Crystal and you want the PLL to multiply it by 16 to get 80 Mhz clock.

    with a 10Mhz Crystal you would specify
    _clkmode = xtal1 + pll8x
    _xinfreq = 10_000_000
    

    to archive the standard 80Mhz clock

    But a 20Mhz Crystal is simply to fast for a P1.

    Enjoy!

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • Peter JakackiPeter Jakacki Posts: 8,702
    edited 2019-01-10 - 04:24:21
    Sure you can use a 20MHz crystal or even a 60MHz, but you can't use that with the PLL which needs a lower frequency like 5MHz to work properly.
    Screenshot_2019-01-10-14-23-08-49.png

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • Sure you can use a 20MHz crystal or even a 60MHz, but you can't use that with the PLL which needs a lower frequency like 5MHz to work properly.
    Yup. The PLL is only spec'd to work with an input frequency between 4 and 8 MHz, although 10 MHz has proven to be reliable. But 20 MHz is way out of spec.

    -Phil
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
  • msrobots wrote: »
    Yes, it is.

    And it is missing the caps too. That's bad. You basically need capacitors on both power inputs of the prop and you need to connect both power inputs. Capacitor from power to ground about 10pf ceramic if I remember correctly. Like the crystal right next to the pins.

    3.3V from FTD1232 is perfectly fine.

    Most sample programs use a 5Mhz Crystal and are running at 80Mhz. With 6Mhz you can get to 96Mhz and some boards are using 10Mhz Crystals. But 5Mhz is most common and that is what most demo programs except.

    Usually at the start of the main program you will find a line stating
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    

    this states that you have a 5Mhz Crystal and you want the PLL to multiply it by 16 to get 80 Mhz clock.

    with a 10Mhz Crystal you would specify
    _clkmode = xtal1 + pll8x
    _xinfreq = 10_000_000
    

    to archive the standard 80Mhz clock

    But a 20Mhz Crystal is simply to fast for a P1.

    Enjoy!

    Mike

    No!
    The 3V3 output from the FD232R is only 50mA and is meant only for the 3V3 I/O drive of the FT232 itself and the pullup to the USB, and a bit extra.
    Even driving a couple of LEDs with the Prop could exceed this! You are just asking for trouble!
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Hi

    Actually some of these FD232R boards convert the usb 5v to 3.3v using a separate regulator as a stand alone circuit and a set of links to select I/O and VCC voltage and make this available on the connecting pins along the edge of the board. This will run modest setups quite happily- I know I used that setup for a long time.
    I think this is what he might be doing.

    Dave
  • So... created an adapter board to be able to easily program the prop chip with an eeprom using the FTD1232 adapter.
    https://oshpark.com/shared_projects/2ivhHA2X
    Haven't tested it yet as it would cost about $18 for 3 boards (lowest amount that they will manufacture).
    Feel free to use it if you want.
  • So, trying to use SimpleIDE and it keeps throwing me Download failed:-1.
    Did a custom proploader config and still the same error.
    Did verbose and it's saying:
    Delivering second-stage loader
    ERROR: Download failed: -1
    
    This is with the same setup that i have before.
    It works fine with spin when trying to run it from the propeller ram, but not with simpleide at all...
    Even tried rcfast and rcslow board types.
    Here's my command line for trying to do this manually:
    "C:\Program Files (x86)\SimpleIDE\bin\proploader.exe" -b custom:default -p COM8 -r -t -I "C:\Program Files (x86)\SimpleIDE\propeller-gcc\propeller-load" Welcome.elf -v
    
  • Cluso99Cluso99 Posts: 15,452
    edited 2019-01-11 - 14:44:12
    You need to verify a few things
    Both sets of power and ground pins connected with bypass caps on both pairs (for DIP40)?
    Eeprom is 24C256 or 24C512? If not, what is it? And eeprom has bypass cap across power and ground?
    3V3 regulator supplies sufficient power? As I said above, FT232R is likely insufficient. Regulator is properly bypassed on both input and output according to the regulator being used - see its specs.
    If all the above ok, then try a simple program using PropTool?

    Presume you are using the DTR transistor reset circuit?

    Once this works, then we can go further.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Propeller Tool with Spin works fine, it's simpleide and proploader that doesnt upload the program.
  • alatnet wrote: »
    Propeller Tool with Spin works fine, it's simpleide and proploader that doesnt upload the program.
    Ok. Sorry, I will have to leave it to those that use SimpleIDE and Proploader.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • I could be wrong, but I think Simple IDE loader assumes the board is using a 5MHz xtal and 80MHz clock.
  • twm47099 wrote: »
    I could be wrong, but I think Simple IDE loader assumes the board is using a 5MHz xtal and 80MHz clock.

    yea, i saw that. Created a custom profile that uses XTAL3 and a 20MHz crystal but it still failed.
    # custom.cfg
    # IDE:CUSTOM
        clkfreq: 20000000
        clkmode: XTAL3
        baudrate: 115200
        rxpin: 31
        txpin: 30
    
  • Peter JakackiPeter Jakacki Posts: 8,702
    edited 2019-01-11 - 23:41:36
    I'm guessing that the PLL is not enabled since the P1's PLL is not designed for this input frequency. Here is an excerpt from the datasheet, page 14, table 14, under PLLENA:
    Enables the PLL circuit. The PLL internally multiplies the XIN pin frequency by 16. OSCENA must be ‘1’ to propagate the XIN signal to the PLL. The PLL’s internal frequency must be kept within 64 MHz to 128 MHz – this translates to an XIN frequency range of 4 MHz to 8 MHz. Allow 100 µs for the PLL to stabilize before switching to one of its outputs via the CLKSEL bits. Once the OSC and PLL circuits are enabled and stabilized, you can switch freely among all clock sources by changing the CLKSEL bits.

    But the second stage bootloader might fail since practically all P1s are run at 80MHz or more, not 20MHz, and the software may not have enough time to write data to the hub before it misses the next character etc.

    Also, there may be another aspect to this and that is the manner in which you have connected the 20MHz crystal. Crystal oscillator circuits are very sensitive to noise since they are effectively an inverted biased into the linear region as a high-gain amplifier (kinda). Those plug-in breadboards are notorious for poor connections and crosstalk and terminal capacitance although it looks like you did the right thing and cut the leads. Did you add those decoupling caps to the supply pins on both sides as required? Note, you may get away without caps when running RCFAST but certainly nothing is guaranteed when you switch to a a higher frequency and/or use multiple cogs.


    EDIT: - Oh yeah, the most obvious after I looked at the photo of your setup. Even with caps it will fail since it seems you are using the 3.3V from the FTDI chip itself which will work when the P1 is only sipping power but as soon as you ramp it up it will fail. For a quick easy "3.3V" you can cheat and just connect two diodes in series from +5V. They can be signal diodes or plain old 1N4004 type diodes, it doesn't matter since they will drop around 700mV each. The voltage may be a little high but that should be ok. Best would be to use an actual 3.3 regulator.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • errr... i didnt cut the leads on the crystal, it's down there pretty well.
    So, im going to have to wait for my 5MHz crystals and capacitors then...
    Well, i can still do some testing with spin and propeller tool and get used to that language.
  • Peter JakackiPeter Jakacki Posts: 8,702
    edited 2019-01-11 - 23:49:34
    alatnet wrote: »
    errr... i didnt cut the leads on the crystal, it's down there pretty well.
    So, im going to have to wait for my 5MHz crystals and capacitors then...
    Well, i can still do some testing with spin and propeller tool and get used to that language.

    Don't miss the EDIT I added to my last post, this was pointed out before it seems.

    Do you have an updated photo - with a clear view of the crystal? And a link to the USB serial module you are using?


    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • alatnetalatnet Posts: 76
    edited 2019-01-12 - 05:15:29
    This would be the best bet for the FTD1232 adapter: https://stak.com/USB_to_TTL_Serial_Adapter__FTDI_FT232RL_chipset__3.3V_and_5V_compatible
    Edit: I do have some 3v3 1W zener diodes.
    Edit2: here's what it says on the crystal:
    multicomp
    20.000F18HO
    
    4656 x 3492 - 2M
  • Yes, that adapter's maximum for 3.3V is 50ma, and that also includes whatever the USB is drawing. You need a better 3.3V.
    Please note that in 5V mode the maximum current draw on this pin is approximately 500mA. In 3.3V mode the maximum current draw on VCC is approximately 50mA.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • Why a zener?
  • Peter JakackiPeter Jakacki Posts: 8,702
    edited 2019-01-12 - 09:55:33
    TO220!? Are you trying to power a tank! I just use tiny little SOT23 or SOT89 regs :)
    BTW - even tiny SOT89 regs can handle 800ma, it all depends upon the input voltage and power dissipation.

    If you are making a power board then you may as well make a board for the Prop and do it "Prop'erly".

    However, even if you only want to prototype you can use the cheap double-side plated through-hole matrix board like this or something similar.

    You basically want matrix board that is tinned and plated through double-sided with individual pads. If you need to join up pads then it is just a case of bending a component lead or solder blobing or even stripping the insulation off some Kynar wire to for a bus or ground etc. So much easier and cleaner than cutting tracks. The tinned pads are also great for surface mount components like 0805 caps and resistors and LEDs etc.


    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
  • alatnetalatnet Posts: 76
    edited 2019-01-12 - 13:43:44
  • Peter JakackiPeter Jakacki Posts: 8,702
    edited 2019-01-12 - 13:48:47
    alatnet wrote: »

    Oh, the humanity!

    If this was the 70's and you had a bunch of transistors then this type of stuff was what you used, that or tag strips. There wasn't much choice. But I can assure you that once you use proper stuff you will never ever want to even see that stripboard stuff ever again. Besides, that stuff would deform and tracks would lift and you had to make a really clean cut or the copper bits would short, and it's not even tinned. The list goes on.

    Here's a sample of a prototype using quality matrix board.
    matrixboard2.jpg



    574 x 271 - 104K
    2613 x 1892 - 724K

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    P2 --- TAQOZ INTRO & LINKS --- P2 SHORTFORM DATASHEET --- TAQOZ RELOADED - 64kB binary with room to spare
    P1 --- Latest Tachyon with EASYFILE --- Tachyon Forth News Blog --- More
    paypal.png PayPal me
    Brisbane, Australia
Sign In or Register to comment.