End user interface and data input into Propeller MCU
Loopyonion
Posts: 24
Hi, Im hoping some knowledgable Propeller users may be able to provide some answers, and guide me in the right direction:)
As a little background on myself, I have a mechanical/electrical engineering past, familiar with very old languages BASIC & MSDOS, newer languages VISUAL BASIC etc, and more importantly, Python from my last six months messing with an arduino "Mega".
I am using the Mega to run some pneumatic solenoids, through FET's, and have hit a point where it was getting messy due to delays, and trying to read sensors whilst delaying actions. And rather than start on interupts etc, came accross information on the Propeller chip.
I have made the decision to go with the Propeller, and also looked into the View Port software, as I need to see what the sensors are reading, and make adjustments accordigly. (Previously, I used arduino sim, not bad at all, but simulation only). I used serial output data to view events, and readings from the Mega.
My question is, how could I produce a system that once I have programmed, can be adjusted by an end user.? I would not want the code altered, just key variables ie timers, and options? I would also need for the end user to visually see on screen the inputs and outputs being created.
I have asked Viewport for an answer, to see if the GUI style development tools would do it, or a cut down version of them is available.
Is serial programming an option? using the serial data stream once configured to output, or input the data required through a windows created program?
Please forgive the number of questions, or my current lack of Spin knowledge.:) , and thanks in advance for any help you can offer!
As a little background on myself, I have a mechanical/electrical engineering past, familiar with very old languages BASIC & MSDOS, newer languages VISUAL BASIC etc, and more importantly, Python from my last six months messing with an arduino "Mega".
I am using the Mega to run some pneumatic solenoids, through FET's, and have hit a point where it was getting messy due to delays, and trying to read sensors whilst delaying actions. And rather than start on interupts etc, came accross information on the Propeller chip.
I have made the decision to go with the Propeller, and also looked into the View Port software, as I need to see what the sensors are reading, and make adjustments accordigly. (Previously, I used arduino sim, not bad at all, but simulation only). I used serial output data to view events, and readings from the Mega.
My question is, how could I produce a system that once I have programmed, can be adjusted by an end user.? I would not want the code altered, just key variables ie timers, and options? I would also need for the end user to visually see on screen the inputs and outputs being created.
I have asked Viewport for an answer, to see if the GUI style development tools would do it, or a cut down version of them is available.
Is serial programming an option? using the serial data stream once configured to output, or input the data required through a windows created program?
Please forgive the number of questions, or my current lack of Spin knowledge.:) , and thanks in advance for any help you can offer!
Comments
Then, it would wait for input on the serial like this: And it changes the motor speed (variable) accordingly.
The Propeller really excels at this, since you can dedicate a core to watching the serial string for new commands, and still have 7 cores left over for your other tasks (like running the solenoids).
If you haven't seen it already, I recommend the PropGCC project for a Propeller C/C++ compiler.
https://code.google.com/p/propgcc/
Here is a video that I did of something very similar: it uses a Python GUI to interface to the Propeller. In this case, it's only receiving data from the Propeller, but it does have the capabilities to dynamically adjust runtime parameters.
So is it possible to store the inputted data from the serial input within the Propeller for use, next time the unit is powered up? ( internal rom etc)..
BTW, welcome to the Propeller forum (which you should be using rather than the General forum)
Thanks, I will have a look at your links on return from work:)
Maybe Admin can move this thread to the appropriate section?
No, the Propeller has to be on. I'd be interested in any MCU that doesn't need to be on to receive data.
That being said, you could run it at a very low clock speed with a single cog to reduce power consumption, if that's what you're looking for.
I understand the MCU cant recieve data when its off , however, whilst the board is powered, a user can input variables, via the serial data method described above. Then I should be able to make the MCU take that data and store in an address within ROM .
Then, when the PC is not connected, and the board powered, fetch that data from the ROM to give a variable a value.
Yes, you can save values to the EEPROM that will persist across power cycles. You'll need an I2C driver for that.
There are two ways that you could do this: "background", and "updateable" (my names):
Background: Every variable has an address, and this address is the same for the HUB RAM (where it lives when it is on), and the EEPROM (from which the hub ram is copied at startup). You could simply write the updated variable value to the address in EEPROM, and the next time that the Propeller is started it "automatically" pulls the updated variable (as if it had been initialized in the code). Note that variable changes would not persist when you change the code, and it would take some extra logic (simple) to make the new values update live in the hub ram.
Updateable: For this, you need a 64KB or larger EEPROM (the default in many modern Propeller boards). In this scheme, you store the values in the upper 32KB of EEPROM space at predetermined locations. From there, your code can pull these values into the code and assign their associated variables. These values will persist across code changes.
I use the updateable method to store things like board number, hardware revision, and file number.
Using a little of all the input above, I think it could be achievable.
Time to get some testing done, and playing with Visual Basic maybe to produce some data streams, and put the Mega up for sale
Thanks for the help so far