Hi, Kamikaze,
What a Bins to download the files from that site !!! ...
and , in the end ... you get a code to download the " LCD + Keyboard " project ...
Someting to correct, I wonder ...
Alain
Hi, Kamikaze,
What a Bins to download the files from that site !!! ...
and , in the end ... you get a code to download the " LCD + Keyboard " project ...
Someting to correct, I wonder ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Not sure about that. I didn't use any of the code from that site - i wrote my own in PBP.
All i used from that site was the receiver amplification/detection part of the circuit shown there.
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
Hi Kamikaze,
I guess the answers to my questions is test and evaluate, in this case I am on the right track.
I started to design arround This guy's project but I was never able to observe what I was expecting on the scope for the input amplification stages and I was not completely understanding what I was doing so I've decided to start with the basics and found this link from Les Johnson which is really basic and I am having some difficulties understanding 100% of his code but I do get the basics.
I am pretty close to a newbe with PBP Pro and PICs, but I am really good at playing sounds on piezzo and blinking LEDs and I think now I am good with LCDs so like I said, I have a long way to go.
I was wondering if it is better to do more hardware and less code or vice versa but I guess the opposite is better since it is faster to change code than it is to change hardware, I am just not sure yet where I have to draw the line.
I am presently intensivelly playing with timers and interupts and I must say I am having a lot of fun trying to understand but as I am doing this on an average of 16 hours per day, I should get the hang of it in no time.
While I am at it maybe if someone can explain something; in my code I have
and then I do this:Code:CMCON = 7 ' Disable comparator INTCON = $80 ' Disable interupts T1CON = 0 ' Timer1 off, prescaler 1:1
I get: TMR1H = 4 and TMR1L = 23Code:TMR1H = 0:TMR1L = 0 T1CON.0 = 1 PAUSEUS 1 LCDOUT $FE,$80,"TMR1H = ", dec TMR1H LCDOUT $FE,$C0,"TMR1L = ", dec TMR1L
What I understand from the datasheet is TMR1H cycles when TMR1L overflows so the value I am getting is actually:
4 x 65535 +23 ?
how did it get do far with PAUSEUS 1 ?
Then if I do PAUSEUS 2
I get: TMR1H = 4 and TMR1L = 24
I am confused!
Mike
TMR1H increments when TMR1L overflows at 256. So its 4x256+23.
Keep in mind that the timer will run at 1/4 the frequency of your main oscillator.
edit: also, pauseus 1 will not result in a 1us pause because pauseus has a minimum pause time. have a look at pauseus in the PBP manual.
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
Do you really have to built it yourself?
Look at the http://www.robot-electronics.co.uk/a...c_Rangers.html
Once I had to built that ranger in 1990 but then I could not find ready made modules.
After a few year I tested the modules of the above link and was surprised.
First of the idea to drive the Tx US transducer by the well known MAX232 chip (it can produce fast +/- 10 volts of pulses!) and second by its simplicity and performance.
Ioannis
Well the main reason why I want to build it myself is to learn everything about it, I really like the challenge and when I go to bed just about every other day or so I sleep well because I like the feeling of having learned something new.
Now trying to calculate and figure how I got this result on my display is probably going to keep me up for a few days because even after Kamikaze's response I am still confused. Maybe it's all about the timing differences between the speed my brain works and the speed of a PIC at 4MHz.
Or maybe I am trying to calculate something that is uncalculatable!
OK, if you are running your PIC at 4MHz, then the timer will run at 1MHz, which means that TMR1L will increment every 1uS (when the prescale is set to 1:1).
timing the command PAUSEUS 1 will not give you a result of 1 becuase of 2 reasons. First, PAUSEUS has a minimum pause time and 1uS is so fast that the time it takes to check the timer value comes into play.
Try this:
temp VAR word
TMR1H=0 ' Reset timer value
TMR1L=0
T1CON.0=1 ' Start the timer
PAUSEUS 1000 ' Pause 1000uS
T1CON.0=0 ' Stop the timer
temp.HighByte=TMR1H
temp.LowByte=TMR1L
LCDOUT $FE,$80,"TMR1 = ", dec temp
The LCD should display somewhere around 1000 - Probably a little more because of the time it takes to start and stop the timer.
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
Bookmarks