electronicsfreak
Member
well, here's my problem.
I've been revising/reworking an old project (might recognize it as the PIC Chronograph from another post)
it is now built with a larger microcontroller, and has a more sensitive 2 gate system.
in the programming, after the first photogate has been broken, the microcontroller will begin increasing a counter/storing #'s in a set of 3 registers.
these three registers will store the # in a decimal format. the first register for the 1ns place, the second for the 10ns place and the third for the 100ns place. (meaning it can only store a number at or below 999)
when the second photogate is broken, the counter will stop increasing this #.
the # stored in these three registers will be the amount of time there is between the breaking of the two gates.
the distance between the two gates is 1ft. it has been set up like this to help make the programming a little bit easier.
I need to somehow divide 1 by that # stored in the three registers so that I can have the device display the speed of whatever broke the two gates, but I have no idea how to do that using the PIC's instruction set.
I am programming in PICassembly using MLAB IDE
any ideas?
attached is the circuit diagram
I've been revising/reworking an old project (might recognize it as the PIC Chronograph from another post)
it is now built with a larger microcontroller, and has a more sensitive 2 gate system.
in the programming, after the first photogate has been broken, the microcontroller will begin increasing a counter/storing #'s in a set of 3 registers.
these three registers will store the # in a decimal format. the first register for the 1ns place, the second for the 10ns place and the third for the 100ns place. (meaning it can only store a number at or below 999)
when the second photogate is broken, the counter will stop increasing this #.
the # stored in these three registers will be the amount of time there is between the breaking of the two gates.
the distance between the two gates is 1ft. it has been set up like this to help make the programming a little bit easier.
I need to somehow divide 1 by that # stored in the three registers so that I can have the device display the speed of whatever broke the two gates, but I have no idea how to do that using the PIC's instruction set.
I am programming in PICassembly using MLAB IDE
any ideas?
attached is the circuit diagram