[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 • Help with an AVR version of the POV Display - Page 3
Page 3 of 4

Re: Help with an AVR version of the POV Display

Posted: Sat Jun 18, 2011 9:17 pm
by robertrndya
here it is.


OK :roll: this code doesn't work. (Just so you don't get frustrated trying to make it work) :)

Re: Help with an AVR version of the POV Display

Posted: Sat Jun 18, 2011 11:02 pm
by bitfogav
All your PORTS are set as Outputs?. There dont seem to be a Input for the sensor?.

Code: Select all

 DDRA=0xFF;
 DDRB=0xFF;
 DDRC=0xFF;
 DDRD=0xFF;
Correct me if im wrong but Brads POV design had a sensor pick up, So when the sensor goes pass a nail the program then draws the data on the LEDs. you just have two For Loops that constantly draws the data on the LEDs.

Re: Help with an AVR version of the POV Display

Posted: Sun Jun 19, 2011 8:31 pm
by brad
Unfortunately I am struggling to follow your C code.

Have you had a look at bitfogavs suggestion? Have you tried going back to basics and instead of trying to make a picture appear - have you tried making sure that you have the correct data at the output? Have you checked that the eeprom is getting the correct info onto that address bus (I.E. it is not accessing a part of the eeprom that you have not programmed?)

Re: Help with an AVR version of the POV Display

Posted: Mon Jun 20, 2011 3:44 pm
by robertrndya
Hi Brad, I haven't checked the output of the eeprom manually. The eeprom contains data from 0000h-0E0Fh. 0000h-0707h contains the word "PUMA" and 0708h-0E0Fh contains the puma logo(Panther). But I feel I'm sure that it doesn't access unprogrammed memory because I've double and triple checked the memory locations while making the hex file of eeprom data. The 1st frame occupies the memory 0000h-0707h and 2nd frame occupies memory 0708h-0E0Fh. So for each frame the processor accesses 1800(decimal) memory locations(for i = 0;i <= 1799;i++).

And yes Bitfogav, all the ports are set as outputs. I haven't incorporated a sensor in my circuit. The main problem is that it's not displaying multiple frames. For displaying a single frame I have just 1 FOR loop that draws data constantly to the LEDs. That works fine. Just that the image keeps drifting round and round, but that's OK, not a problem for me. Now for displaying 2 frames i just copied the same FOR loop and pasted it again. And I used 2 more FOR loops {for (n = 0;n<2;n++)} to repeat each of the main FOR loops twice(i.e. to display each frame 2 times before moving on to the next frame). BUT I DID CHANGE THE STARTING MEMORY LOCATION for accessing the 2nd frame(a = 07h & b = 08h). But it just shows some random colors and the LEDs don't even blink. I tried making the processor run through both frame locations at 1 shot only (i.e. from 0000h-0E0Fh), which again is kinda like displaying just 1 frame, and that also worked fine. But I could see PUMA and the panther both together(like in 1 frame only). When I say I want to display multiple frames I mean that at 1 time it should display ONLY PUMA and at another time it should display ONLY the Panther. I feel there is a problem when I put the EXTRA 2 FOR loops (for repeating the same frame twice). But I can't understand WHAT EXACTLY is the problem. :( :cry: :cry: :roll: :cry: :cry: :(

Re: Help with an AVR version of the POV Display

Posted: Mon Jun 20, 2011 8:25 pm
by brad
Have you tried displaying each frame more than just twice? maybe at least ten or twenty times each. Sometimes it's very handy to go to the extreme (when all else fails)

Something that could come in VERY handy is a logic analyser, it will show you exactly whats going with your data bus / address bus and is a great tool for fault finding this sort of thing.

A good one is this:
http://www.saleae.com/logic/

Re: Help with an AVR version of the POV Display

Posted: Wed Jun 22, 2011 3:18 pm
by robertrndya
Alright, it started working. My friend was helping me with this problem, and he tried different things and at the end all he did is he copied the initializing statements and pasted them before the WHILE loop as well, i.e. the address variables (a & b), latch selecting variable (j), and the control ports (Port C & Port D). Now we have no idea how that makes a difference but it works that way. He just happened to try that out and to our surprise it worked.

Re: Help with an AVR version of the POV Display

Posted: Thu Jun 23, 2011 2:41 am
by bitfogav
I see what you mean now, You wasn't initializing your variables before the main "While" loop.

That would probably affect the optimizations of the AVR IDE.

Re: Help with an AVR version of the POV Display

Posted: Thu Jun 23, 2011 2:54 pm
by robertrndya
Yes but I was initializing them within the while loop. I was initializing the variables every time it starts a new frame.

Re: Help with an AVR version of the POV Display

Posted: Thu Jun 23, 2011 10:03 pm
by brad
robertrndya wrote:Alright, it started working. My friend was helping me with this problem, and he tried different things and at the end all he did is he copied the initializing statements and pasted them before the WHILE loop as well, i.e. the address variables (a & b), latch selecting variable (j), and the control ports (Port C & Port D). Now we have no idea how that makes a difference but it works that way. He just happened to try that out and to our surprise it worked.
Unfortunately I don't think I would have picked that up unless it was a language I used myself :)

Re: Help with an AVR version of the POV Display

Posted: Sat Jun 25, 2011 3:05 pm
by robertrndya
hehehe.....it didn't make much sense to us either. LOL :wink: :lol:

Re: Help with an AVR version of the POV Display

Posted: Thu Jul 14, 2011 3:35 pm
by robertrndya
Hi Guys,

Its been a long time. The POV Display is working fine now. But I have to still spend sometime getting the right data from the software to put in the EEPROM.

Anyways, whats your latest project guys?

Re: Help with an AVR version of the POV Display

Posted: Fri Jul 15, 2011 9:59 pm
by brad
My latest project is renovating the new house we have just moved into!

When my new Super Pixel Bros Boards arrive I will test them out and document it though, until then I am painting, plastering, putting in new lights and all sorts of things like that :)

Re: Help with an AVR version of the POV Display

Posted: Fri Jul 15, 2011 10:31 pm
by sdudley
brad wrote:My latest project is renovating the new house we have just moved into!... I am painting, plastering, putting in new lights and all sorts of things like that :)
Ah, I see... You're neglecting your duties.

Listen man, you need to get a grip on what's really important in life - ok! :P

Stacy

Re: Help with an AVR version of the POV Display

Posted: Sat Jul 16, 2011 4:26 pm
by robertrndya
All the best with that brad... :lol:

Re: Help with an AVR version of the POV Display

Posted: Sat Jul 16, 2011 10:49 pm
by brad
Thanks everyone! (except for Stacy...)