Shop OBEX P1 Docs P2 Docs Learn Events
Emic Problem — Parallax Forums

Emic Problem

HumanoidoHumanoido Posts: 5,770
edited 2008-10-16 09:57 in BASIC Stamp
The Emic is on a Basic Stamp 2 HomeWork board. The wiring is checked and appears good. The battery is new and tested good. Two DIP switches are in the OFF or down position. The program is loaded in and it works fine. Then the battery is disconnected and reconnected and it says, "Basic stamp primary computer working." It misses the first two sentences. At this time, if reset is pressed, it works fine. I would like it to say all three sentences at power on. Any ideas?

Comments

  • MSDTechMSDTech Posts: 342
    edited 2008-10-13 11:25
    You might add a pause at the beginning of the program to allow the emic time to initialize its circuits. When you start the system by applying power, the display takes some time to power up and come to life. I works when you press reset because the display has initialized and is sitting ready to display.
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-10-13 13:14
    Thanks for your reply MSDTech - the board is apparently very slow and an extra PAUSE 2000 at the beginning fixed the problem, exactly as you suggested!

    I'm happy it works - I wonder if there are any timing rules/formula to follow when using serial to communicate from board to board... thanks again!
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-10-13 17:31
    According to the EMIC manual, in hex mode (which you're using), upon power up/reset you'll receive
    a byte 0x55 (or 'U') from the EPIC. You'd probably be best looking for it near the beginning of your program
    rather than a PAUSE xxxx.

    [noparse][[/noparse]Edit: You could use the Wait_OK routine from the sample code in the manual.]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rusty-
    --
    Rusty Haddock <=> AE5AE
    **Out yonder in the Van Alstyne (TX) Metropolitan Area**
    Microsoft is to software what McDonalds is to gourmet cooking

    Post Edited (Fe2o3Fish) : 10/13/2008 5:47:26 PM GMT
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-10-14 08:31
    Fe2o3Fish said...
    According to the EMIC manual, in hex mode (which you're using), upon power up/reset you'll receive a byte 0x55 (or 'U') from the EPIC. You'd probably be best looking for it near the beginning of your program rather than a PAUSE xxxx.
    Thanks for the tip. Checking the manual, the dip switch was put into ascii mode, the busy line was stripped out for one less interface wire, the demo was discarded, the code was rewritten - stripping out the pause statements, changing the syntax, and using the PBASIC Syntax and Reference Guide, entered the serial code input statement to catch the ready command, essentially eliminating the hardware busy line and writing software in its place. It's interesting to note, the PAUSE command works but the system can go faster using the serial code input. It works every time, power on, reset, during various programming modes, or even when interrupted due to power crashes or line disconnects. It's working! Thanks everyone!

    Post Edited (humanoido) : 10/14/2008 8:36:44 AM GMT
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-10-14 12:23
    Additional note: one thing that happened was any rapid interruption of power caused it to hang. That was fixed by using the hard reset line and a few lines of code. Now there's a problem with trying to enter the (control-P) start of phonetic text.

    The question is how to send a control-P when the emic is in text mode? Obviously it cannot be sent as text. In the Editor, typing a control-P brings up the print screen. I checked the stamp reference and tried sending hex which is a $10 serially on a code line by itself and that didn't work (system hangs).

    The manual on page 10 shows a list of allowable ascii characters, and control-P shows as ^P. But sending that as text is not working. My guess is the Emic text mode won't read the hex. Any ideas for a workaround?
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-10-16 02:01
    Hum'
    You might try:
    SEROUT Tx, Baud, [noparse][[/noparse]16]

    but I'm not sure why $10 didn't work unless that, as you said, is on a source code line
    by itself -- that's just not legit PBASIC.

    "^P" is just a textual representation of Control-P -- a byte containing the value 16 (decimal) --
    and not a string sent on the serial line to the EMIC.

    BTW, you really never want to put a raw control character into a source code file.
    Pressing Control-P inside the editor is a command to the editor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rusty-
    --
    Rusty Haddock <=> AE5AE
    **Out yonder in the Van Alstyne (TX) Metropolitan Area**
    Microsoft is to software what McDonalds is to gourmet cooking
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-10-16 09:57
    The Emic board is working now and the problems are fixed. Timing and command syntax must be perfect for it to run properly. The HEX $10 works, even when Emic is in ASCII mode, but it must be placed outside the text stream when sent, using the exact syntax found here:
    http://forums.parallax.com/forums/default.aspx?f=5&m=300923
    My sincere thanks to everyone who contributed to the success of this project. humanoido
Sign In or Register to comment.