Jump to content
43oh

garyamort

Members
  • Content Count

    21
  • Joined

  • Last visited

Reputation Activity

  1. Like
    garyamort got a reaction from larsie in Turning a Launchpad into a poor mans IOIO   
    I've been working on turning a Launchpad into a poor mans IOIO. The latest version of the IOIO adds support for connecting from the computer to the board using a bluetooth serial connection. This means if I copy the underlying protocol[or at least as much as I need] - I can then emulate the IOIO for my real goal[see below].
     
    I'm just in the beginning phase right now, my initial goal is to get it working so I can use the IOIO protocol to turn on and off the 2 LED's on board. IE just cloning the Digital Output functionality and only on 2 pins.
     
    I'm hoping to finish that this weekend. Right now I just have the initial skeleton of combining the TI example code for 9600 baud uart and some basic IOIO headers.
    https://github.com/garyamort/IOIOExtension
     
    Once I get the 2 pins working, the next step is to allow for access to all 10 available pins on the MSP430G2553 [there is 1 and a half ports available, but 2 pins have to be used form the serial connection].
     
    This is where I figured I'd ask if there is a standard way of doing things as I'm re-learning C as I go along.
    A command will consist of a few bytes of data:
    The command byte, such as I beleive 6 and 7 for digital output. 6 to turn a pin into a digital output, 7 to change the value being sent out. Following the command is the "pin number" - where pin number is defined by where they come out on the board, not where they are on the launchpad.
     
    For my purposes:
    Pin 1: Port 1.0
    Pin 2: Port 1.3
    Pin 3: Port 1.4
    Pin 4: Port 1.5
    Pin 5: Port 1.6
    Pin 6: Port 1.7
    Pin 7: Port 1.0
    Pin 8: Port 2.1
    Pin 9: Port 2.2
    Pin 10: Port 2.3
    Pin 11: Port 2.4
     
    For the simple case of:
    Pins 1 and 5[1.0 and 1.6] I can use a simple switch/case to send the correct BIT to P1SEL
     
    However, to expand it to all 10 pins, I would rather not have a humungous SWITCH/CASE. It would be better to have a mapping of pins to their appropriate bit, port address, and value. Something like:
     
    PINDEF selectedPin = pinmap[1];
    selectedPin->port |= selectedPin->digitalOutBit;
    selectedPin->iovalue |= selectedPin->digitalOn;
     
    While I understand easily how to do the digitalOutBit and digitalOn - they are just values. The question is how to I assign a variable[selectedPin->port] so that it can be used in the same manner as P1SEL ?
     
     
    Thanks for any feedback.
     
    Sidenote: my /goal/ is yet another oscilliscope. However, since my strongest skillset is website engineering[php/HTML/CSS/Javascript] - my preference is to make the scope as a Javascript application run from the web browser. I can hack enough Python to use the Python serial and websocket library to provide access to the com port from the web browser - so with that in place it makes it a lot faster for me to write IOIO apps which will also be usable with a Launchpad by using Javascript.
     
    For added fun, I want to setup a PHP library so that I can have the launchpad display the number of users on a website via an LED bargraph and maybe have it play a sound when different "goals" are met.
     
     
    NOTE: I found I had to hunt through the project settings in CCS to find and enable the "relaxed-ansi" option in order to get the "packed" structures to work.
  2. Like
    garyamort got a reaction from dacoffey in Turning a Launchpad into a poor mans IOIO   
    I've been working on turning a Launchpad into a poor mans IOIO. The latest version of the IOIO adds support for connecting from the computer to the board using a bluetooth serial connection. This means if I copy the underlying protocol[or at least as much as I need] - I can then emulate the IOIO for my real goal[see below].
     
    I'm just in the beginning phase right now, my initial goal is to get it working so I can use the IOIO protocol to turn on and off the 2 LED's on board. IE just cloning the Digital Output functionality and only on 2 pins.
     
    I'm hoping to finish that this weekend. Right now I just have the initial skeleton of combining the TI example code for 9600 baud uart and some basic IOIO headers.
    https://github.com/garyamort/IOIOExtension
     
    Once I get the 2 pins working, the next step is to allow for access to all 10 available pins on the MSP430G2553 [there is 1 and a half ports available, but 2 pins have to be used form the serial connection].
     
    This is where I figured I'd ask if there is a standard way of doing things as I'm re-learning C as I go along.
    A command will consist of a few bytes of data:
    The command byte, such as I beleive 6 and 7 for digital output. 6 to turn a pin into a digital output, 7 to change the value being sent out. Following the command is the "pin number" - where pin number is defined by where they come out on the board, not where they are on the launchpad.
     
    For my purposes:
    Pin 1: Port 1.0
    Pin 2: Port 1.3
    Pin 3: Port 1.4
    Pin 4: Port 1.5
    Pin 5: Port 1.6
    Pin 6: Port 1.7
    Pin 7: Port 1.0
    Pin 8: Port 2.1
    Pin 9: Port 2.2
    Pin 10: Port 2.3
    Pin 11: Port 2.4
     
    For the simple case of:
    Pins 1 and 5[1.0 and 1.6] I can use a simple switch/case to send the correct BIT to P1SEL
     
    However, to expand it to all 10 pins, I would rather not have a humungous SWITCH/CASE. It would be better to have a mapping of pins to their appropriate bit, port address, and value. Something like:
     
    PINDEF selectedPin = pinmap[1];
    selectedPin->port |= selectedPin->digitalOutBit;
    selectedPin->iovalue |= selectedPin->digitalOn;
     
    While I understand easily how to do the digitalOutBit and digitalOn - they are just values. The question is how to I assign a variable[selectedPin->port] so that it can be used in the same manner as P1SEL ?
     
     
    Thanks for any feedback.
     
    Sidenote: my /goal/ is yet another oscilliscope. However, since my strongest skillset is website engineering[php/HTML/CSS/Javascript] - my preference is to make the scope as a Javascript application run from the web browser. I can hack enough Python to use the Python serial and websocket library to provide access to the com port from the web browser - so with that in place it makes it a lot faster for me to write IOIO apps which will also be usable with a Launchpad by using Javascript.
     
    For added fun, I want to setup a PHP library so that I can have the launchpad display the number of users on a website via an LED bargraph and maybe have it play a sound when different "goals" are met.
     
     
    NOTE: I found I had to hunt through the project settings in CCS to find and enable the "relaxed-ansi" option in order to get the "packed" structures to work.
  3. Like
    garyamort got a reaction from thanhtran in Turning a Launchpad into a poor mans IOIO   
    I've been working on turning a Launchpad into a poor mans IOIO. The latest version of the IOIO adds support for connecting from the computer to the board using a bluetooth serial connection. This means if I copy the underlying protocol[or at least as much as I need] - I can then emulate the IOIO for my real goal[see below].
     
    I'm just in the beginning phase right now, my initial goal is to get it working so I can use the IOIO protocol to turn on and off the 2 LED's on board. IE just cloning the Digital Output functionality and only on 2 pins.
     
    I'm hoping to finish that this weekend. Right now I just have the initial skeleton of combining the TI example code for 9600 baud uart and some basic IOIO headers.
    https://github.com/garyamort/IOIOExtension
     
    Once I get the 2 pins working, the next step is to allow for access to all 10 available pins on the MSP430G2553 [there is 1 and a half ports available, but 2 pins have to be used form the serial connection].
     
    This is where I figured I'd ask if there is a standard way of doing things as I'm re-learning C as I go along.
    A command will consist of a few bytes of data:
    The command byte, such as I beleive 6 and 7 for digital output. 6 to turn a pin into a digital output, 7 to change the value being sent out. Following the command is the "pin number" - where pin number is defined by where they come out on the board, not where they are on the launchpad.
     
    For my purposes:
    Pin 1: Port 1.0
    Pin 2: Port 1.3
    Pin 3: Port 1.4
    Pin 4: Port 1.5
    Pin 5: Port 1.6
    Pin 6: Port 1.7
    Pin 7: Port 1.0
    Pin 8: Port 2.1
    Pin 9: Port 2.2
    Pin 10: Port 2.3
    Pin 11: Port 2.4
     
    For the simple case of:
    Pins 1 and 5[1.0 and 1.6] I can use a simple switch/case to send the correct BIT to P1SEL
     
    However, to expand it to all 10 pins, I would rather not have a humungous SWITCH/CASE. It would be better to have a mapping of pins to their appropriate bit, port address, and value. Something like:
     
    PINDEF selectedPin = pinmap[1];
    selectedPin->port |= selectedPin->digitalOutBit;
    selectedPin->iovalue |= selectedPin->digitalOn;
     
    While I understand easily how to do the digitalOutBit and digitalOn - they are just values. The question is how to I assign a variable[selectedPin->port] so that it can be used in the same manner as P1SEL ?
     
     
    Thanks for any feedback.
     
    Sidenote: my /goal/ is yet another oscilliscope. However, since my strongest skillset is website engineering[php/HTML/CSS/Javascript] - my preference is to make the scope as a Javascript application run from the web browser. I can hack enough Python to use the Python serial and websocket library to provide access to the com port from the web browser - so with that in place it makes it a lot faster for me to write IOIO apps which will also be usable with a Launchpad by using Javascript.
     
    For added fun, I want to setup a PHP library so that I can have the launchpad display the number of users on a website via an LED bargraph and maybe have it play a sound when different "goals" are met.
     
     
    NOTE: I found I had to hunt through the project settings in CCS to find and enable the "relaxed-ansi" option in order to get the "packed" structures to work.
  4. Like
    garyamort got a reaction from oPossum in Turning a Launchpad into a poor mans IOIO   
    I've been working on turning a Launchpad into a poor mans IOIO. The latest version of the IOIO adds support for connecting from the computer to the board using a bluetooth serial connection. This means if I copy the underlying protocol[or at least as much as I need] - I can then emulate the IOIO for my real goal[see below].
     
    I'm just in the beginning phase right now, my initial goal is to get it working so I can use the IOIO protocol to turn on and off the 2 LED's on board. IE just cloning the Digital Output functionality and only on 2 pins.
     
    I'm hoping to finish that this weekend. Right now I just have the initial skeleton of combining the TI example code for 9600 baud uart and some basic IOIO headers.
    https://github.com/garyamort/IOIOExtension
     
    Once I get the 2 pins working, the next step is to allow for access to all 10 available pins on the MSP430G2553 [there is 1 and a half ports available, but 2 pins have to be used form the serial connection].
     
    This is where I figured I'd ask if there is a standard way of doing things as I'm re-learning C as I go along.
    A command will consist of a few bytes of data:
    The command byte, such as I beleive 6 and 7 for digital output. 6 to turn a pin into a digital output, 7 to change the value being sent out. Following the command is the "pin number" - where pin number is defined by where they come out on the board, not where they are on the launchpad.
     
    For my purposes:
    Pin 1: Port 1.0
    Pin 2: Port 1.3
    Pin 3: Port 1.4
    Pin 4: Port 1.5
    Pin 5: Port 1.6
    Pin 6: Port 1.7
    Pin 7: Port 1.0
    Pin 8: Port 2.1
    Pin 9: Port 2.2
    Pin 10: Port 2.3
    Pin 11: Port 2.4
     
    For the simple case of:
    Pins 1 and 5[1.0 and 1.6] I can use a simple switch/case to send the correct BIT to P1SEL
     
    However, to expand it to all 10 pins, I would rather not have a humungous SWITCH/CASE. It would be better to have a mapping of pins to their appropriate bit, port address, and value. Something like:
     
    PINDEF selectedPin = pinmap[1];
    selectedPin->port |= selectedPin->digitalOutBit;
    selectedPin->iovalue |= selectedPin->digitalOn;
     
    While I understand easily how to do the digitalOutBit and digitalOn - they are just values. The question is how to I assign a variable[selectedPin->port] so that it can be used in the same manner as P1SEL ?
     
     
    Thanks for any feedback.
     
    Sidenote: my /goal/ is yet another oscilliscope. However, since my strongest skillset is website engineering[php/HTML/CSS/Javascript] - my preference is to make the scope as a Javascript application run from the web browser. I can hack enough Python to use the Python serial and websocket library to provide access to the com port from the web browser - so with that in place it makes it a lot faster for me to write IOIO apps which will also be usable with a Launchpad by using Javascript.
     
    For added fun, I want to setup a PHP library so that I can have the launchpad display the number of users on a website via an LED bargraph and maybe have it play a sound when different "goals" are met.
     
     
    NOTE: I found I had to hunt through the project settings in CCS to find and enable the "relaxed-ansi" option in order to get the "packed" structures to work.
×
×
  • Create New...