Shop OBEX P1 Docs P2 Docs Learn Events
serial and eeprom problems...please help — Parallax Forums

serial and eeprom problems...please help

smillysmilly Posts: 2
edited 2007-09-08 07:25 in BASIC Stamp
we are running a simple master - slave test on a modular house. basically we are trying to control a light ballast and an automated window blind to maximize the energy efficiency of the modular house. to do this, we have a master pod with a BS2p stamp that is polling information off of a slave/sensor pod. every five minutes, the master requests the temperature and light data from the slave/sensor pod. once this data is retreived, the master pod goes into its actuation routine. the recursive loop in our control is constantly trying to get the updated data from the sensor pod to provide the next step of actuation in the control. once things are stable enough to the desired light and temperature conditions, it goes back and waits five minutes. attached is the master and slave code.

we are getting some really odd numbers when we try debug the master code with what it is getting from the slave. i am wondering if we are not formatting it correctly, or if there is something we are just missing??? is there something about x-10 that screws with the data (random i know)? we seem to get a packet of info that isn't separated properly...

on another note, we are storing these values in the EEPROM of the master pod to later go back and analyze the data. we are getting some really funking data points. attached is a file of some of the data we are storing...can someone please help.

thanks.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2007-09-07 21:05
    My first instinct is that it's a grounding problem. You DID run a ground wire, right?
  • smillysmilly Posts: 2
    edited 2007-09-07 21:07
    yes. everything that should have a ground is common grounded.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-09-08 05:31
    Hi smilly, you could try and synch the data to see if there is an improvement in reliability

    SEROUT SO, Baud, [noparse][[/noparse]"!",CR,DEC4 light2,CR, DEC2 temp2,CR]

    SERIN POD2data,stamp_BAUD,[noparse][[/noparse]WAIT("!"),DEC4 light2,DEC2 temp2]

    Jeff T.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-09-08 07:25
    smilly -

    In the Master_6 program you use the following:

    DO WHILE ((light2 > 90)&(i < 7))

    I suspect you may have wanted to use this:

    DO WHILE (light2 > 90) AND (i < 7)

    Additionally, you are using various STORE commands to alter the program slot used for EEPROM storage. Are you sure you want to be doing that?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.