pic16f84a

Reply

Join Date: Dec 2007
Posts: 5
Reputation: samari is an unknown quantity at this point 
Solved Threads: 0
samari samari is offline Offline
Newbie Poster

Re: need source code for digital alarm clock using pic16f84a

 
0
  #1
Dec 11th, 2007
  1. void main()
  2. {
  3. TRISA=0x00;
  4. TRISB=0x00;
  5. while(1)
  6. {
  7. PORTB=0x06;
  8. PORTA=0x01;
  9. delay(10);
  10. PORTB=0x5B;
  11. PORTA=0x02;
  12. delay(10);
  13. PORTB=0x4F;
  14. PORTA=0x04;
  15. delay(10);
  16. PORTB=0x66;
  17. PORTA=0x08;
  18. }
  19. }
This a few program that i make in creating a scoreboard for basketball using PIC 16f84a..Is this program correct??
Last edited by Ancient Dragon; Dec 12th, 2007 at 9:18 am. Reason: add code tags, but didn't help much
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,853
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 300
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Roasting Maven

Re: pic16f84a

 
0
  #2
Dec 12th, 2007
How is this a scoreboard? Correct me if I'm wrong, but it looks to me that this program just makes a number of outputs 'high' with a delay of 10 (sec/msec??) Where is the delay function because it isn't standard so you probably wrote it (or 'found' it).
How do you change the output? In other words: where do you read anything?
Change void main() to int main() that's the way it's defined.

Regards Niek

p.s. Please use code tags in your next posts
Last edited by niek_e; Dec 12th, 2007 at 8:18 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 514
Reputation: Jishnu will become famous soon enough Jishnu will become famous soon enough 
Solved Threads: 26
Jishnu's Avatar
Jishnu Jishnu is offline Offline
Posting Pro

Re: pic16f84a

 
0
  #3
Dec 12th, 2007
Looks like you are looking forward to interface LCD display (presuming that would serve the purpose of a scoreboard) using PIC microcontroller.

Please, in such projects, you need to be very very specific with the hardware connections that you've made. Also, specify the exact nature of the display you want (i.e. what you want to display when). After all, that would help us in helping you .
"You know you're a computer geek when you try to shoo a fly away from the monitor screen with your cursor. That just happened to me. It was scary." - Juuso Heimonen.

"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: pic16f84a

 
0
  #4
Dec 12th, 2007
> Is this program correct??
No.
For a basketball scoreboard, don't you need things like
- the amount of time played, or the time left.
- the score for each team.
- a means of updating the score for each team (press one of two buttons say).
- other buttons to say start/stop the clock for timeouts, reset the clock for the next period of play, maybe even adjust the time at the referees discretion.

As niek_e and Jishnu have pointed out, you need to show us exactly how all your hardware is wired up, what kind of display device (7-segment LED, dot-matrix LCD, or whatever) and anything else specific to your implementation. Your code might do something, but it doesn't read any input, and the output doesn't seem to vary.

If you're using some off the shelf development board, then telling us what that is would definitely help.

> Change void main() to int main() that's the way it's defined.
Actually, this would qualify as a "free-standing" implementation, so anything goes, so long as you read the documentation.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 327
Reputation: Colin Mac is on a distinguished road 
Solved Threads: 22
Colin Mac Colin Mac is offline Offline
Posting Whiz

Re: pic16f84a

 
0
  #5
Dec 12th, 2007
Looks like there are four 7-segments being mutiplexed together.
PORTB sends the data out to the 7-segment selected in turn by PORTA with a slight delay between each.

I have no experience with C programming on PICs so I can't say if the program is right. Does it compile?.

A quick look at the pinout though says you have only one input pin left. If I'm right about the wiring you also have one of port B's pins unused which I imagine you would have to make an input if you want to do things like, select the team's score to increment and by how many points etc.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 241
Reputation: ssharish2005 is on a distinguished road 
Solved Threads: 20
ssharish2005's Avatar
ssharish2005 ssharish2005 is offline Offline
Posting Whiz in Training

Re: pic16f84a

 
0
  #6
Dec 17th, 2007
That piece of code just keeps in reating the same thing again and again for ever. I mean it just displays the same thing. U will have to update something as the game goes along. So you will have to get some input from a particular source.

And have u tried compiling and running that program. I guess u are using some 16bit complier.

ssharish
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 5
Reputation: samari is an unknown quantity at this point 
Solved Threads: 0
samari samari is offline Offline
Newbie Poster

Re: pic16f84a

 
0
  #7
Dec 18th, 2007
sorry for the late reply because I'am to busy with may study..our speak give that program to us..its a program,a running program but it is in incresing from..I would like to change it into decreasing form so that me and may group can create our design as a manual digital scoreboard....

We are using 7 segment LED display,because our teacher wants us to use that..we have the schematic part of the scoreboard but the only thing that we cannot solve is the program of it using PIC16f84a in C....

sorry for the inconvince...I'am a new in this PIC that we are using...Sorry....Thanks for any help that any one can help..........
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 327
Reputation: Colin Mac is on a distinguished road 
Solved Threads: 22
Colin Mac Colin Mac is offline Offline
Posting Whiz

Re: pic16f84a

 
0
  #8
Dec 18th, 2007
Attach the schematic here then.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC