i have couple of months trying to learn how to compile programs in assembly and it's very interesting. by now i'm working on 2 projects. i have to say that i'm a newbie in assembly but i'm trying :)
the 1st is a hex counter which counts from 00-0F and then goes back to 00. the counter is increased every time a pushbutton is pressed.the result is displayed in two 7-segment displays i've made the code but this is working only for one 7-segment. i asked this issue with some friends and they told me that if i use interupts and multiplexing i'll solve the problem. but i thing that because the first 7-seg. will be always "0" i would have the same result if i plug it into the power supplier.

hex counter.doc <---attached

the other one is a little bit complicated. it's an electronic dice. as you know this is based on a random choice. i didnt write the program yet cause i'm stuck in this random function. i've downloaded the data sheet pdf from microchip site but i didnt find anything about this. i searched over the net to find a complete program but nothing at all.
i think it is like the hex counter one with some differences. for example i'll start with a function that will call a table where i'll save all 6 numbers a dice can have. and i'll type a random function to pick every time another number. can somebody help me more with that program?

but i thing that because the first 7-seg. will be always "0" i would have the same result if i plug it into the power supplier.

Look at the pdf attached. Connect up your two 7-segs similar to that. The only difference here is, there are 4 in parallel here, you only need two.

Enable 1st, send out 0.
Turn off 1st. Enable 2nd, send out 1

Apply that logic in a loop and 01 is displayed.

and according to that block diagram how can i compile it in assembly? :)

yeah my program is running well but the 1st 7-segment isnt showing the digit "0" because i cant program it. is it possible for you to write me a part of that multiplexing procedure in assembly?

is it possible for you to write me a part of that multiplexing procedure in assembly

It isn't possible without knowing which type transistors you're using and whether
you're using common anode or common cathode 7-segments. Also I don't use PIC micros.
Here's an 8051 example multiplexing 1234 to four 7-segs, along with the circuit diagram.
http://www.edsim51.com/examples.html#prog3
Attach your new schematic showing the two 7-segments multiplexed along with the relevant code to multiplex just 2 digits first and we should see where the problem is.

i finally made the hex counter. i attached the txt below. the only thing is that i have to find a way to stop the increasing automaticaly. i want to press a pushbutton to increase the digit by 1. every press one step further. any ideas?

If all your doing is counting from 00 - 0F, perhaps one way would be to store the codes for your hex numbers in RAM. Use indexed addressing to step through the memory if you read a pushbutton signal and display that number on the display. Point back to the first address on a reset signal.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.