[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
Brads Electronic Projects Forum • Inverted pulses to led matrix
Page 1 of 1

Inverted pulses to led matrix

Posted: Wed Oct 20, 2010 7:27 am
by tgraz34
Okay so i just got done building the 8x8 game system and i noticed a few problems. Ive only uploaded pong onto it for right now.


The problem is it looks like the 8bits being sent to the display are inverted like instead 11110011 it comes out as 00001100 i think.

The first picture is what the screen should look like and the second picture is what it looks like right now.

Im thinking it has something to do with the difference between brads newer 8x8 schematic and the older one. I have a feeling that inorder to make the newer 8x8 game system schematic work is by changing the code so that the 8bits are sent inverted to the 74373's. But i could be completely wrong.

Can someone please help me out and tell me why this is happening.

Untitled.png
Untitled.png (42.87 KiB) Viewed 15307 times
ccvxc.png
ccvxc.png (54.12 KiB) Viewed 15307 times

Re: Inverted pulses to led matrix

Posted: Wed Oct 20, 2010 2:43 pm
by brad
Yep they certainly do look inverted!

All you need to do is to invert the data before it is sent from the W register to your output port. So just add this line before sending it:

Code: Select all

xorlw b'11111111'
You can also have a look at an earlier post I have made here:

viewtopic.php?f=20&t=33

Re: Inverted pulses to led matrix

Posted: Thu Oct 21, 2010 6:59 am
by tgraz34
I see how that little piece of code works but i just dont know where to put it, im still a n00b at programming. :(

I'm guessing somewhere in the draw_paddle or draw_ball subroutine. Could you maybe give me a hint to where it should go. :D

Thanks

Re: Inverted pulses to led matrix

Posted: Sat Oct 23, 2010 8:02 am
by tgraz34
UPDATE: i figured out where to put that little piece of code. It was kind of a no brainer.

Thank for your help. Now i can start working on adding a second player. :D

Re: Inverted pulses to led matrix

Posted: Sun Oct 24, 2010 9:10 pm
by brad
Good work!