| | |
pic16f84a
![]() |
•
•
Join Date: Dec 2007
Posts: 5
Reputation:
Solved Threads: 0
c Syntax (Toggle Plain Text)
void main() { TRISA=0x00; TRISB=0x00; while(1) { PORTB=0x06; PORTA=0x01; delay(10); PORTB=0x5B; PORTA=0x02; delay(10); PORTB=0x4F; PORTA=0x04; delay(10); PORTB=0x66; PORTA=0x08; } }
Last edited by Ancient Dragon; Dec 12th, 2007 at 9:18 am. Reason: add code tags, but didn't help much
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
Regards Niek
p.s. Please use code tags in your next posts
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.
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
.
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.
"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
> 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.
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.
•
•
Join Date: Sep 2006
Posts: 327
Reputation:
Solved Threads: 22
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.
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.
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
And have u tried compiling and running that program. I guess u are using some 16bit complier.
ssharish
•
•
Join Date: Dec 2007
Posts: 5
Reputation:
Solved Threads: 0
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..........
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..........
![]() |
Similar Threads
- need source code for digital alarm clock using pic16f84a (Assembly)
- Turn on a LED for 5 minutes Use PIC16F84A (Assembly)
- I need help covert my source code frm pic16c54a to pic16f84a (Assembly)
Other Threads in the C Forum
- Previous Thread: newbie: C-Program write to /var/log/mylog via syslog
- Next Thread: pass an array from one function to another
| Thread Tools | Search this Thread |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile createcopyoffile createprocess() directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o ide inches include infiniteloop initialization input intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test threads unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi






