Shop OBEX P1 Docs P2 Docs Learn Events
Need more variable space and (I/O) in a stamp - Project is DS1302 clock -SX vid — Parallax Forums

Need more variable space and (I/O) in a stamp - Project is DS1302 clock -SX vid

T&E EngineerT&E Engineer Posts: 1,396
edited 2005-10-25 01:27 in BASIC Stamp
I wanted to upgrade my DS1302 real time clock (with SX video module display) to add in speech from an ISD25120. However, when writing the code, it said I ran out of variable space with my BS2 chip. I·have the·BOE-BOT with the BS2 chip and Board of Education rev c that I am using only the microcontroller board (no robotics yet).

Can someone recomend a 'good' Stamp to upgrade to with plenty of variable space (and more I/O pins would be helpfull).

I am interfacing an ISD25120 (2 minute speech chip) and it alone used up all 16 I/O pins for various functions. However, I was able to use a 74HC595 to reduce it to 11 pins (first 8 pins reduced to 3). I was also going to use 4 of the 8 output pins on the SX video module. This should have barely fixed my I/O issues except that I ran out of variable space.

I need a stamp that can fit in·my Board of Education rev C. to keep the costs down.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-23 22:01
    Hello,

    ·· Upgrading your Stamp Model isn't going to help your variable issues.· Some have more RAM, but not more variable space (This is a compatibility thing).· Anyway, there are several ways you can reduce variable usage.· One is to always make sure you declare a variable for the minium size needed to have data in it.· For example, don't declare a byte for a on/of 1/0 state variable,·use a bit.· If you only need a counter from 0-9 use a nibble.

    ·· Another thing is to re-use variables.· I have seen programs where variables were declared for a one time use.· Often you can re-use variables.· There is a pretty good example in the Projects Forum, "Binary Digital Clock."· In that program several I/O pins, constants and variables we shared/re-used.

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-23 22:22
    Chris,

    So the only way to get more variable space (and more I/O) is to use 2 BS2 stamps?

    What is the compatibility issue?· Can you explain this a little more?

    What about using a SX type chip? Can they be programed in BS2.5 basic or only assembly?

    I just don't think I can re-use any of the variables in my programs (as I need them for the speech chip, DS1302 and SX video module and a couple more for misc) but I will check again. I was pretty creative in using a 595 and outputs on the SX video module alone for more outputs. confused.gif



    Post Edited (tdg8934) : 10/23/2005 10:28:03 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-23 22:33
    The SX can be programmed in assembly or in SX/B -- not completely PBASIC 2.5 compatible (uses 8-bit values only), but very close. Also lets you mix programming, so you can use assembly where required, and even do interrupts in BASIC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-23 22:34
    Okay,

    ·· I think you misunderstood my comparison of the BASIC Stamp Models.· Some are faster and have more features, etc.· But All the BASIC Stamp Models have the same number of bytes of variable space.

    ·· As for re-using variables.· Say you have a variable called, out595 which you send data out to the 74HC595.· You have another variable called, outEmic for sending data to the Emic module.· You could actually use the same variable for both devices.· You create on variable, say, ioByte.· And now you send ioByte to the 74HC595 and then load it with the data for the Emic and send it out to the Emic.

    ·· This can be done to more of a degree than what I just demonstrated, again, check out that code.· I think I am using the same set of variables for something like 5 devices.· I could've even saved more variable space if need be, but I would've sacrificed readability by less experienced users, and I didn't need any more space.· But think about it...The Binary Digital Clock has a DS1302, a DS1620, three 74HC595 Shift Registers and a MAX7219, and I still have variable space left.· This is why I pointed it out to you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BeanBean Posts: 8,129
    edited 2005-10-23 22:49
    tdg,
    · Have you considered using something instead of the ISD25120 ?
    · The emic speech module that Parallax sells needs only 2 I/O pins.

    BTW Sounds like a great project. When you get it working let me know, I'll give you one of my new video overlay modules if you let me post your project on my website.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    Life is NOT a box of chocolates.
    Life is a trip, and 99% of the time you get where your headed.



    Post Edited (Bean (Hitt Consulting)) : 10/23/2005 10:52:16 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-23 23:19
    Bean,

    I really want to use the ISD25120 (as I used the ISD1000A family) back in college as a student project a few years back and somewhat familier with it.

    I was unaware of the emic speech module and the cost is somewhat higher (but the development work is done). I may purchase one and incorporate it. I like the natural female voice too.

    This hobby is getting more and more expensive for a talking video clock but hey it's really fun!

    I will take you up on your offer. I will do my best to get around the variables issue (if possible) and use the sx video outputs. I am still learning the BS2 language so I am taking my time to get it right.



    Timothy Gilmore
  • OrionOrion Posts: 236
    edited 2005-10-24 00:25
    You could upgrade to a stamp with scratchpad memory and shift your variables in and out of the scratchpad. If you got one with I2C commands you could use the MCP23016 and use only 2 pins to control 16 or more I/Os for the ISD25120.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-24 01:00
    You'll be much happier with the Emic than with the 25120 -- the 25120 has a 2Kz limit and, in my opinion, the audio quality is barely usable. And you're limited to 2 minutes of prerecorded speech; not so with the Emic. The Emic is just a tiny bit robotic, but the synthesis is actually done from recorded speech so it's much better than older systems, and you're not limited in how much speech you can have. And, to an earlier point, you only need a couple connections.

    If you really want to go the ISD approach, you could purchase one of our AP-8 audio boards and replace the 2560 with the 25120. At least this would give you serial control, albeit of only eight speech segments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BeanBean Posts: 8,129
    edited 2005-10-24 01:31
    Timothy,
    If you post your code maybe one of us can help you out.
    I'll give you a choice either an emic speech module OR an SX video overlay module.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    Life is NOT a box of chocolates.
    Life is a trip, and 99% of the time you get where your headed.

    ·
  • denodeno Posts: 242
    edited 2005-10-24 04:22
    Hello...just a speech chip addition...

    I started out along time ago with the Digit Talker from Jameco, then I discovered the SP0256-al2 from General Instrument, then the ISD series, then the EMIC device.· The EMIC is very good as you can really load up the BS2sx with lots of sentences as DATA statements for various robot phrases.· But, after it is all said and done, I just liked the sound that the SP0256-al2 produced for robotics.·(It sounds like a robot should sound, to me anyway). But, it was time consuming to build words from scratch.

    Which brings me to a web site that still offers the SP0256-al2 and what looks like, a remanufactured speech chip similar to the SP0256-al2.· Take a look at www.speechchips.com.· This new speech chip uses only a couple of I/O's. (I think you can get it down to one I/O).· Anyway, just my 2 cents worth.

    Also, on the above web site is a "Chip Talk" emulator (free), that now builds the words using the various alaphones for you.· It used to take me hours to build a sentence that was 15 or 20 words long, with commas of course.

    I like the EMIC, but my next talking project will use one of the above speech chips in it.·

    Happy speaking to everyone...deno

    PS..I have no connection with the above web site, and have not, as of yet, tried the new speech chip offer there.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-24 04:29
    If you're referring to the SpeakJet, we carry it as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • denodeno Posts: 242
    edited 2005-10-24 04:47
    Yes, you do, I see that now....I stand corrected.

    deno
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-24 11:54
    Wow..what a response!

    I thank everyone for there knowledge, expertise and hospitality (especially Bean for the offer).

    I think for the time being I will first use what I have being the ISD25120 and BS2 with the SX video module for my talking video clock project (and add a few chips to release more data I/O if needed). However, once finished I will probably upgrade it using the Emic module or video overlay board (Bean?) and provide a posting when finished. It will take me some time to put this together as I am somewhat new to this and a little bit rusty in microcontrollers.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-25 01:27
    I have updated my DS1302 Video clock program in the Projects forum.

    ============================

    I have taken Chris Savage's·advice (from another post) (modified his DS1302 program to add SX video module usage) and reduced the variable size (and fixed a couple of minor bugs I didn't see). It is now more efficient and has more variable space.


    Original program (first post listing)
    Ram Map
    INS:
    :
    REG7:
    + 1 Nibble

    New Program (posted here)
    Ram Map
    INS:
    :
    REG5:
    + 2 bits

    I will take this modified program and try to reduce space in·a modified·ISD25120 program I will write (originally written for Nuts and Volts #66 by Jon Williams) to combine them and create a "talking video clock".

    Thanks to Chris, Jon and Bean for their help!
    =============================
Sign In or Register to comment.