Shop OBEX P1 Docs P2 Docs Learn Events
Understanding the BS2pe AVR co- processors' commands. — Parallax Forums

Understanding the BS2pe AVR co- processors' commands.

Deano1936Deano1936 Posts: 15
edited 2012-03-01 10:01 in BASIC Stamp
Hi ya all,
I'm working with a "BS2pe" mo- board and I'm having a hard time understanding the AVR co- processors command protocol. I have a strong background in the Hex, octal, decimal and binary numbering systems. So I'm probably making this a lot harder than it needs to be. I've petty much digested the "AVR Firmware: GPIO, version 3 manual. (all nine pages). Can anyone tell me where I can find some more info that might help me understand these owio commands?

Dean

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-02-29 17:24
    Dean,

    Check the PBASIC manual for details about how OWIO works. Next, take a look at some of the AVR example calls. Then, if you have any questions about a specific command found in the examples, return here to ask, and I'll try to help.

    -Phil
  • Deano1936Deano1936 Posts: 15
    edited 2012-03-01 09:47
    Thanks Phil,
    I've been using source codes written by you and a few other people. They work --- but I don't know what I,m doing.
    Take the command " OWOUT 10, 0, [$10]" . According to the manual this statement will write a digital one to port 2.
    It doesn't say which AVR it will use. I'm assuming the 10 is P10 of the BS2pe that feeds AVR "A" but I'm not sure
    because 10 is also a binary "2". How does this statement designate which AVR (A or B), which AVR port will go high, and what data is to be sent?

    THANKS AGAIN FOR YOUR TIME.
    Dean
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-03-01 10:01
    Yes, the first OWOUT parameter is the pin number, so the "10" refers to P10, which addresses AVR A. "10" is not a binary 2, BTW. That would be expressed as "%10".

    The second argument is the mode, which you can read about in the PBASIC manual. "0" specifies no reset, byte mode, low speed. All interaction with the AVR has to be low-speed byte mode. But you can use modes that include a reset.

    The data that gets sent is whatever appears between brackets []. "$10" is 16 in hexadecimal.

    -Phil
Sign In or Register to comment.