Between the 'dir portb out' and the 'do' lines the program runs.
I would say that the table of pointers is not being populated becouse the functions are not compiled unless specificaly called.
However the 'wait' statement is needed for some reason
Just having:
setled1
setled2
setled3
setled4
fails the same as the first test code
What am I missing?
Cheers
Chris
EDIT:
Another test, changing the wait to 100 ms implies that the setup code is looping, dispite being out side of the loop. Eventualy it stops entierly, my guess is that the table is still not being populated correctly and that the Processor is resetting when it enters the loop.
Last edit: Chris Roper 2015-09-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You do not think you can have pointers in tables as you are defining them.
Data tables can be define by (in Great Cow Basic v0.95 or greater - you will be able to use items 1, 2 and 3 in earlier versions).
1. a single value on each line
2. multiple elements on a single line separated by commas
3. constants and calculations within the single line data table entries are permitted
4. an external data source file
The table is not being created beyond the four byte length of the table.
So, the question is. What are you trying to achieve ? I am sure we have other methods to achieve the goal you are looking require.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Leave this for a day or two and check back. But, you may be able to use one of the new features of v0.95 of Great Cow Basic to do this. Need to talk to Hugh to get his view.
Please hold in there.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to create a table of pointers to functions but this test code is not working.
No errors are generated, it compiles and flashes fine, but does nothing.
Am I attempting the impossile or do I have a syntax error ?
I am testing with the Microchip 28 pin demo board.
Ultimately I need two tables of 255 entries each, the above is just a simplified test of concept.
Any advice and help would be appreciated.
Chrees
Chris
Last edit: Chris Roper 2015-09-25
I have made some progress:
By adding:
Between the 'dir portb out' and the 'do' lines the program runs.
I would say that the table of pointers is not being populated becouse the functions are not compiled unless specificaly called.
However the 'wait' statement is needed for some reason
Just having:
fails the same as the first test code
What am I missing?
Cheers
Chris
EDIT:
Another test, changing the wait to 100 ms implies that the setup code is looping, dispite being out side of the loop. Eventualy it stops entierly, my guess is that the table is still not being populated correctly and that the Processor is resetting when it enters the loop.
Last edit: Chris Roper 2015-09-25
You do not think you can have pointers in tables as you are defining them.
Data tables can be define by (in Great Cow Basic v0.95 or greater - you will be able to use items 1, 2 and 3 in earlier versions).
1. a single value on each line
2. multiple elements on a single line separated by commas
3. constants and calculations within the single line data table entries are permitted
4. an external data source file
The table is not being created beyond the four byte length of the table.
So, the question is. What are you trying to achieve ? I am sure we have other methods to achieve the goal you are looking require.
I am using the v0.94 build and have tried with both multypal eliment single line and the version shown above.
I was reading item 3 to imply that I could use the @function style as a calculation/constant.
Here is what I am trying to achive:
Given a Byte lookup and execute the two functions assosiated with fetching the argument and executing the opperation on the argument.
It is a CPU emulation for educational use and the lookup tables would change between CPU types.
To attempt that dual lookup with a Select Case or If Then statements would be too slow and verbose.
Cheers
Chris
Last edit: Chris Roper 2015-09-25
Thank you - this helps me understand.
Leave this for a day or two and check back. But, you may be able to use one of the new features of v0.95 of Great Cow Basic to do this. Need to talk to Hugh to get his view.
Please hold in there.
Thanks Evan,
Much appreciated
Cheers
Chris