@ Peter:
I do love the challenge of learning something new. Thank you for your time is assisting me in this endeavor.
You say:
"When you want to read or write or perform an operation on a variable's contents you simply invoke it's name. Now if you want to tell some other function about a variable you need to pass the address of the variable rather than the variable's content"
Perhaps it has to do with the size of my programs, but I've never had to use the @. It seems that all of my calls to a variable between methods within my programs
work without needing to invoke the @. You refer to some other function. Is that other function in another cog? Is that why you need to give the address using @?
That kind 'a makes sense. Or, is that other function within another object that was included using a pointer to it? Such as...
OBJ
pst : "Paralax Serial Terminal"
pst.char("Y")
There seems to be some subtle differences here and there with this Spin language that I don't fully understand. I took a couple of classes ten years ago, and those
were one term each. C++ and ASM. Just enough to get an understanding, and not enough to keep from getting confused about the subtle things.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
I took a look at your code. I see that you are using an LCD. Which one are you using? It seems by your code that it's a serial interface. I have an LCD
leftover from my BS2 era. It's not serial, but I have a PIC an LCD chip to run it serially. Not sure how difficult it would be to get that working.
I do have a nice 4 x 4 keypad that I plan on using in another project. It has 8 pins, and I've figured out how to use it with 8 pins. I also have a keypad
decoder IC that outputs the key pressed on 4 output lines, saving 4 pins. But, with 32 pins, I don't see the need. So many more pins, so little time.
Thanks for the help/code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
I've been reading the manual. It states that the Main RAM has 8192 longs, and that any one cog has 512 longs. I understand that during boot time, all of Main RAM
gets written from EEPROM. Then cog 0 gets loaded from Main RAM and starts running. Main RAM is larger than the cog's RAM, so I assume that the entire
program does not get loaded into the cog. Does this thing load only a few lines of code at a time, execute those lines, and then load some more lines etc? Or,
does it simply start another cog? No, that doesn't seem right.
I have another book that came with my KIT/demo board called: Programming and Customizing the Multicore Propeller uC, the Official Guide. It states that the
cog RAM is for use only by the that cog. If you need to get a variable's value to another cog, is this where you use Main RAM to pass it along? And is this where
you use that pesky @ symbol?
How does one know where their variables reside? In cog RAM or Main RAM? Or, do all variable reside in Main RAM and cog RAM is used only for local variables
when using the PRI method?
It's all so confusing right now. The books are not real clear; sort of cursory. Some sort of table/chart showing the interaction of all the parts would be helpful to me. I
once saw such a chart laid out for Java. It really helped me to see the overall layout/structure of the language.
Thanks to everyone for helping me understand.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
You said "Then cog 0 gets loaded from Main RAM and starts running."
It is not correct. COG 0 starts from ROM area that are after HUB area IT's SPIN interpreter then INTERPRETER starts Yours SPIN program.
In that Program You START next COG's if You wish. Some with SPIN interpreter's some with PASM code from DAT's area in You programs That have that (Mostly drivers have that).
BUT always COG 0 with start of Yours User Program starts with SPIN Interpreter and in most cases not change that.
Regards
Christoffer J
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Nothing is impossible, there are only different degrees of difficulty. For every stupid question there is at least one intelligent answer. Don't guess - ask instead. If you don't ask you won't know. If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Hi Sapieha,
Yes, I see that in the book. The app gets put into Main RAM (and possibly EEPROM). And quoting the book mentioned above, "Upon application launch,
a single cog runs the ROM-based Spin interpreter and executes the application from Main RAM. From there, the application can launch additional cogs
on Spin or asm code, as needed."
A question, additional cogs ONLY get started when told to do so by the application? Hence, by the developer of the application. Correct? I don't find an answer
to this in either book. My guess is that this is the case. Makes sense.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
YES - It is You that decide that in Yours application.
COGNEW and COGSTOP control that in Yours application.
Regards
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Nothing is impossible, there are only different degrees of difficulty. For every stupid question there is at least one intelligent answer. Don't guess - ask instead. If you don't ask you won't know. If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Comments
I do love the challenge of learning something new. Thank you for your time is assisting me in this endeavor.
You say:
"When you want to read or write or perform an operation on a variable's contents you simply invoke it's name. Now if you want to tell some other function about a variable you need to pass the address of the variable rather than the variable's content"
Perhaps it has to do with the size of my programs, but I've never had to use the @. It seems that all of my calls to a variable between methods within my programs
work without needing to invoke the @. You refer to some other function. Is that other function in another cog? Is that why you need to give the address using @?
That kind 'a makes sense. Or, is that other function within another object that was included using a pointer to it? Such as...
OBJ
pst : "Paralax Serial Terminal"
pst.char("Y")
There seems to be some subtle differences here and there with this Spin language that I don't fully understand. I took a couple of classes ten years ago, and those
were one term each. C++ and ASM. Just enough to get an understanding, and not enough to keep from getting confused about the subtle things.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
I took a look at your code. I see that you are using an LCD. Which one are you using? It seems by your code that it's a serial interface. I have an LCD
leftover from my BS2 era. It's not serial, but I have a PIC an LCD chip to run it serially. Not sure how difficult it would be to get that working.
I do have a nice 4 x 4 keypad that I plan on using in another project. It has 8 pins, and I've figured out how to use it with 8 pins. I also have a keypad
decoder IC that outputs the key pressed on 4 output lines, saving 4 pins. But, with 32 pins, I don't see the need. So many more pins, so little time.
Thanks for the help/code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
gets written from EEPROM. Then cog 0 gets loaded from Main RAM and starts running. Main RAM is larger than the cog's RAM, so I assume that the entire
program does not get loaded into the cog. Does this thing load only a few lines of code at a time, execute those lines, and then load some more lines etc? Or,
does it simply start another cog? No, that doesn't seem right.
I have another book that came with my KIT/demo board called: Programming and Customizing the Multicore Propeller uC, the Official Guide. It states that the
cog RAM is for use only by the that cog. If you need to get a variable's value to another cog, is this where you use Main RAM to pass it along? And is this where
you use that pesky @ symbol?
How does one know where their variables reside? In cog RAM or Main RAM? Or, do all variable reside in Main RAM and cog RAM is used only for local variables
when using the PRI method?
It's all so confusing right now. The books are not real clear; sort of cursory. Some sort of table/chart showing the interaction of all the parts would be helpful to me. I
once saw such a chart laid out for Java. It really helped me to see the overall layout/structure of the language.
Thanks to everyone for helping me understand.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
You said "Then cog 0 gets loaded from Main RAM and starts running."
It is not correct. COG 0 starts from ROM area that are after HUB area IT's SPIN interpreter then INTERPRETER starts Yours SPIN program.
In that Program You START next COG's if You wish. Some with SPIN interpreter's some with PASM code from DAT's area in You programs That have that (Mostly drivers have that).
BUT always COG 0 with start of Yours User Program starts with SPIN Interpreter and in most cases not change that.
Regards
Christoffer J
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Yes, I see that in the book. The app gets put into Main RAM (and possibly EEPROM). And quoting the book mentioned above, "Upon application launch,
a single cog runs the ROM-based Spin interpreter and executes the application from Main RAM. From there, the application can launch additional cogs
on Spin or asm code, as needed."
A question, additional cogs ONLY get started when told to do so by the application? Hence, by the developer of the application. Correct? I don't find an answer
to this in either book. My guess is that this is the case. Makes sense.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"She may not be very pretty now, but she was somebody's baby once." Bugs Bunny
YES - It is You that decide that in Yours application.
COGNEW and COGSTOP control that in Yours application.
Regards
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha