Programming

Post here to discuss the original 8x8 Game System.

Moderators: Chuckt, Garth, bitfogav

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Programming

Post by bitfogav » Tue Jul 19, 2011 7:44 pm

sdudley wrote: I am beginning to believe there is something wrong with the internal architecture of the 16f648a microconrollers.
Stacy,

You are correct when saying it has something wrong with the internal architecture of the 16F648a microcontrollers, infact any 16F microcontroller.

I think it has something to do with the limited call stack, The key thing to understand about the 8 bit PIC architecture is that the stack size is fixed and the 16f648a has a stack size of 8.

If the 8x8 game system used a 18F series microcontroller with a call stack of 31 then I dont think there will be much of a problem other than the time it will take to programme all the games onto the 18F microcontroller.


Heres all ive got to run on the 16f648a, Brads version of the bouncing balls and the race car game, with some personal changes eg added 3 lives to the race car game and I use the bouncing balls has a sorta screen saver?.


User avatar
1kiko1
Can't get enough of electronics!
Can't get enough of electronics!
Posts: 57
Joined: Wed Jun 29, 2011 11:16 pm

Re: Programming

Post by 1kiko1 » Wed Jul 20, 2011 12:46 pm

can you fit all the 8x8 game system games into a 18f

User avatar
sdudley
Moderator
Moderator
Posts: 337
Joined: Sun Mar 28, 2010 1:33 pm
Location: Florida, U.S.A.

Re: Programming

Post by sdudley » Thu Jul 21, 2011 10:52 am

Thanks for the info Chuck but the 8 level call stack is not the problem. I have gone through the code and replaced most of the CALL directives with GOTO directives (where they could be replaced). When I run the program on the simulator I watch the call stack and have managed to keep everything under 8 levels. Of course I have also replaced any of the applicable RETURN's to GOTO's as well so the program will return correctly.

I had originally found a problem with the way Brad accesses the table data and have fixed that (it was jumping page boundaries) but that only solved one of the problems I was having. Again, everything runs great in the simulator, just not in the circuit. :x

In the video below, I did not explain it very well, but I can get either game to work correctly, just not both.



Stacy
Any time you deviate from sequential consistency, you increase the complexity of the problem by orders of magnitude.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Programming

Post by bitfogav » Fri Jul 22, 2011 2:51 am

Hey Stacy nice video, I was under the impression that you was adding all of Brads 8x8 games to the microchip, that what lead me to think that the problem could be with the call stack?, with two games or so that should'nt be a problem?.

Just so I can understand your problem abit more, Do the race track game work ok the first time you turn the power on and if you start the race track game first?

if you would like me to I could try your code on my system and test the results? :)



ps. have you been playing too many games with your thumb bandage? Or is that from trying to sort this problem out!! :lol:

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm

Re: Programming

Post by brad » Fri Jul 22, 2011 9:21 pm

Really like the video Stacy!

I remember you working on getting multiples games working on the one chip and all of our conversations about page boundaries and data tables - fun times :)

User avatar
sdudley
Moderator
Moderator
Posts: 337
Joined: Sun Mar 28, 2010 1:33 pm
Location: Florida, U.S.A.

Re: Programming

Post by sdudley » Thu Jul 28, 2011 11:40 am

Sorry for skipping out on the conversation guys but I got really busy at work and haven't had the opportunity to chat much on the forum.

I also started a project that was supposed to take only a few hours over the weekend but somehow ended up taking up the majority of the weekend and I still didn't finish. :x

I was hoping to show you the finished product but it will have to wait. For now here is a sneak peek...
R&D-sign_001.png
R&D-sign_001.png (355.77 KiB) Viewed 13457 times

@ Bitfogav,

I had started my program by adding all of the games on the chip but when I could not get the games to work correctly, I narrowed it down to just two games. I still could not get two games to work correctly. As I mentioned before, when Brad decided to move to the SPB, I moved on to other projects. From time to time, when a new idea pops in my head, I will pull out the program and try it.

Thanks for the offer to debug it on your circuit and I might take you up on it some time. I actually have several different versions of the program that I started because I was trying to figure out the best way to implement the algorithm (I love that word). I will need to go through the programs and find the one which would be least confusing to explain! :wink:

By the way, the bandage is simply to cover up a nasty black area under my thumbnail where I smashed it in a car door.


@ Brad,

Yes I remember the good ole' days of page boundaries and data tables. You should come back to the dark side young Jedi. :twisted:


Stacy
Any time you deviate from sequential consistency, you increase the complexity of the problem by orders of magnitude.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm

Re: Programming

Post by brad » Thu Jul 28, 2011 9:10 pm

What is that crazy thing? a doomsday device? A flux capacitor?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Programming

Post by bitfogav » Fri Jul 29, 2011 1:45 am

sdudley wrote:Thanks for the offer to debug it on your circuit and I might take you up on it some time. I actually have several different versions of the program that I started because I was trying to figure out the best way to implement the algorithm (I love that word). I will need to go through the programs and find the one which would be least confusing to explain!
Well anytime Stacy just give me a shout when your ready!! :)

User avatar
sdudley
Moderator
Moderator
Posts: 337
Joined: Sun Mar 28, 2010 1:33 pm
Location: Florida, U.S.A.

Re: Programming

Post by sdudley » Fri Jul 29, 2011 12:49 pm

What is that crazy thing? a doomsday device? A flux capacitor?
No silly, it's an edge-lit acrylic sign I am going to hang above the entrance to my lab at work! :D

Finished...
R&D-sign_002.png
R&D-sign_002.png (371.49 KiB) Viewed 13453 times
R&D-sign_003.png
R&D-sign_003.png (367.27 KiB) Viewed 13453 times
R&D-sign_004.png
R&D-sign_004.png (269.51 KiB) Viewed 13453 times
Stacy

PS> Forgive me for hijacking the thread... now back to the programming topic! :mrgreen:
Any time you deviate from sequential consistency, you increase the complexity of the problem by orders of magnitude.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm

Re: Programming

Post by brad » Fri Jul 29, 2011 9:08 pm

Image

You are the thread hijacker!

By the way, nice sign!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests