Shop OBEX P1 Docs P2 Docs Learn Events
A working MEMKey program for BS2P40??? — Parallax Forums

A working MEMKey program for BS2P40???

$WMc%$WMc% Posts: 1,884
edited 2008-10-29 01:20 in BASIC Stamp
Hello All

····· I'm looking for a simple little program that will interface the MEMKey to the BSp????


· ___________Thanks_________$WMc%___________

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-10-25 02:49
    The code here within the PDF document should also work with the BS2P40 ... see page 11

    www.parallax.com/Portals/0/Downloads/docs/prod/datast/memkey.pdf
    www.parallax.com/Store/Sensors/CustomKits/tabid/134/txtSearch/MEMkEY/List/1/ProductID/192/Default.aspx?SortField=ProductName%2cProductName

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-25 04:14
    Mr.Schwabe

    ·I thank you for Your reply!!!...I am useing the programs used in the links You included.They work great w/ the BS2...Thier seems to be a "timing" issue w/ the BS2p...I can't seem to pin point.?...It seems to be in the serial protocal. I looked in the Manule (pg 396~ to 420~) the chart shows that ( 1021 ) should be the CON value for the serial protocal for the BS2p but It doesn't work...I did the math and came up w/ (1021).When the MATH doesn't work the Formula must be wrong!?!?......."(396) works perfict for the BS2"....(1021) should work for the BS2p But it doesn't....AN-302 is the program I mod. for the BS2p..All I changed was the "CON" statment to "1021" from "396"......What am I missing???????????????.........

    I'll take any help,,I'm @ My wits end_______________%WMc$____________

    Post Edited ($WMc%) : 10/25/2008 4:51:55 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-10-25 05:06
    $WMc%,

    Can you post the exact code that you are using?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-25 18:49
    Mr. Schwabe

    ·· Here is the code I Mod. from AN-302



    ____Thanks for the help________$WMc%__________________


    Post Edited ($WMc%) : 10/26/2008 5:53:06 PM GMT
  • kelvin jameskelvin james Posts: 531
    edited 2008-10-25 19:59
    I would highly doubt you had this working with a bs2, if so, lets see the code. For one thing, the memkey is communicating in hex, so if you are looking for a keypress of decimal 00, take a quess of what the result is. You should be able to figure it out from here.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-25 21:21
    Mr. James

    I have used this porgram w/ the BS2 and it works great. The program I used is AN-302 for the BS2....This is the genearic Program from MEMKey...I thank You for Your post....My Problem is w/ the BS2P!!!!!!!!!!!!!!......I don't know if the problem is in timing or compiler directive?I have other members of this FORUM asking Me for help on this topic w/ the BS2P....We would all like a fix to the problem..

    _____________________$WMc%____________________Think Posative++++++++++++
  • kelvin jameskelvin james Posts: 531
    edited 2008-10-25 22:11
    I have used the memkey with a bsp24 with no problem using the 3 wire setup. I have not tried the one wire approach. All that i know is the baud rate of 1021 works. From my previous post, the key read values are sent in hex, so either you read them that way, or use a dec formatter with serin.

    I use the initialization code to set the parameters first, some of your previous code may have changed the default settings. I would try going back to the 3 wire approach with the initialization, you will have to change all the 396 to 1021, and see if that works.

    If not, you have a hardware problem somewhere, either wiring or with the mcu itself. If i have some time tomorrow, i will try the one wire thing to see if it works.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-26 17:48
    Mr. James

    · I Thank You for Your reply.I have cleaned up the Progam to make it a lil. clearer.This program works great w/ the BS2 and (Baud CON· 396),But it doesn't work w/ the BS2p40 and (1021)??? :I get values that are out of range like 55,57,49.....I see the argument You have·w/ "DEC2" and I'm not sure why this works w/ BS2 but it does. One otherthing I have done is switch to Editor v2.4 from v2.2...What Editor Ver. are You useing????



    _______________$WMc%__________________Thanks Again____
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-27 23:08
    Hello again

    ········ Mr. James I tried the 3 wire setup and used AN-300 w/ a Baud value of 396 and the BS2. This worked w/ the BS2...I shut down the power removed the BS2 and installed the BS2p40/changed the Baud to 1021 and the Stamp directive·; downloaded to the BS2p40 and nothing. All I get is the blank blue " debug " screen·of nothingness...I have used this BS2p40 w/ a serial LCD @ 19.2kBaud and it·was pretty fast,So I still don't think this is faulty hardware. I'm useing the PRO.DEV.Board for these test.



    ____________________$WMc%________________??????____
  • kelvin jameskelvin james Posts: 531
    edited 2008-10-28 05:41
    I don't have a dev board, but the manual states that there is a pin conflict if you try and use a bs2p40 with the sx28 in its socket at the same time. Maybe this is the problem?


    I suppose you realize that the bsp40 and the 24 versions are not pin compatible, so a wiring change would be required also. It looks if you just used P0 to P7 you would be okay to do a quick switch.

    Post Edited (kelvin james) : 10/28/2008 4:28:16 PM GMT
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-29 01:20
    Hello All

    ·hop.gif·· The First thing I have to say is I AM NOT smarter than a 5th grader.Sure enough I was on the wrong·I/O pin X15 and not P15.Whats even worse is I added the AUX. socket to the Pro.Dev.Board about 6 months ago so I could get to all 32 I/O pins w/ the BS2P40.When Mr James pointed out the too where NOT pin for pin compa. it hit Me like a ton of Bricks. I don't know where My heads been the last couple of weeks But it was dark and smelled funny.....I have attch. A working code for the Pro.Dev.Board w/ the ser. pin on PIN 0, hopfully this will save some confusion.

    ______ManyThanks_______________________$WMc%___________________out________

    ·· Heres the pinout everybodys asked for...It's for use w/ the Matrix keypad on A OneWireBus..
    ·· Don't forget the resize ICON @ the lower rigth of the screen,to resize a jpeg.....

    Post Edited ($WMc%) : 11/1/2008 9:19:43 PM GMT
Sign In or Register to comment.