Hello,
I am in the course of programming a PIC 16F819 for school. All the hardware has been set up correctly and it can be seen here, drawn in Multisim: http://img212.imageshack.us/img212/3207/drawingeq1.png
I will add the finished schematic tomorrow. This one might contain some mistakes, but it should give you the general idea for now. The "Sonalert" are representing a ultrasound transmitter and a reciever.
The hardware has been tested and it is set up probably. So after spending 6 hours today trying to fix the software and I haven't been able to do so. Before I post the code I want to say I am no expert, which is why I am asking for help here.
What I am trying to do: I want the microcontroller to calclulate the distance between the ultrasound sender (and receiver for that matter) and a flat surface. The idea was to calculate how much the Timer0 would count to for what corrosponds to 1 cm and then add it all up.
D = 0,5 * C * (T - T0) and this means that I could do the following:
1 = 0,5 * 344 * (Count / Frequency / 64) * 100 --> ~3
With the frequency being 4MHz and the prescaler at 1:64.
I hope this is enough introduction to the project and if not please tell me what you need to know to help me, it is a project within a certain timeline so any help would be great
The .asm file can be found at: http://www.wikiupload.com/download_page.php?id=89014
I am not sure if it is better that I post all of it here or linked to it.
I am in the course of programming a PIC 16F819 for school. All the hardware has been set up correctly and it can be seen here, drawn in Multisim: http://img212.imageshack.us/img212/3207/drawingeq1.png
I will add the finished schematic tomorrow. This one might contain some mistakes, but it should give you the general idea for now. The "Sonalert" are representing a ultrasound transmitter and a reciever.
The hardware has been tested and it is set up probably. So after spending 6 hours today trying to fix the software and I haven't been able to do so. Before I post the code I want to say I am no expert, which is why I am asking for help here.
What I am trying to do: I want the microcontroller to calclulate the distance between the ultrasound sender (and receiver for that matter) and a flat surface. The idea was to calculate how much the Timer0 would count to for what corrosponds to 1 cm and then add it all up.
D = 0,5 * C * (T - T0) and this means that I could do the following:
1 = 0,5 * 344 * (Count / Frequency / 64) * 100 --> ~3
With the frequency being 4MHz and the prescaler at 1:64.
I hope this is enough introduction to the project and if not please tell me what you need to know to help me, it is a project within a certain timeline so any help would be great
The .asm file can be found at: http://www.wikiupload.com/download_page.php?id=89014
I am not sure if it is better that I post all of it here or linked to it.