Stuff you want to REPEAT needs to be in between the REPEAT
UNTIL.
Like
REPEAT
this
UNTIL this
Not
REPEAT
UNTIL this
do this
Stuff you want to REPEAT needs to be in between the REPEAT
UNTIL.
Like
REPEAT
this
UNTIL this
Not
REPEAT
UNTIL this
do this
I am using the repeats as delays so the pic waits for the data basically. The data being sent comes in as 3 seperate 8-bits in sequence. The data is read off of PortJ. The data always comes after PortA.5 goes low. Ant it is always in a specific order. If I miss any 1 of the three I cannot tell what the actuall character is.
How neat the signal on PORTA.5 is? Where this signal come from?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Looking at the signal in question on an o-scope, It looks pretty clean to me. It is connected to a 100K pull-up to 5V. The transition from high to low does have some ringing , that lasts about 90nS give or take, but the peaks are all < 0, so it should still be seen as a low.
Reduce it!!! Let's say ~1-10K pull-up.
AND, wait a few Usec after you detect the falling edge...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Wiat let me correct that... I just looked at the schematic, there is not a pull up on PortA.5. Sorry about that, I did not do the hardware, I am just doing the programming.
I have a 3uS pause after the falling edge (was 1uS, but Alain correct me on that already)
Thanks for all your help so far guys...
I am still learning this digital stuff, and have been slowly making my way up the hill.
A floating input would for sure screw-the-pooch since it returns a random value when
the port pin is read...;o}
Hi,
1) @20Mhz ... min Pauseus is ... 3µs !!!
2) UNTIL NOT PortA.5 is much quicker than UNTIL PortA.5 = 0
3) PortF.6 = 1 is much quicker than HIGH PortF.6
4) Instead of Repeat - Until NOT PortA.5, try While PortA.5 - Wend ...
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 " !!!
*****************************************
In fact, you should use LATF.x instead of PORTF.x ...
Alain, OP says WHILE:WEND didn't work.. not sure why... sounds odd...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
************************************************** ***********************
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 " !!!
*****************************************
YEah but this will throw you an error for a 18FBTFSC Porta,5
GOTO $-1
GOTO $-2 would be better
Maudit Francais!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Couple of things... My code as it is shown works for the most part as long as the loop does not get hung up.
1) Made the change, seems to work as before....
2) Made change code works as it did before
3) I will randomly miss characters, changed it back to what I originally had
4) Made change, I no not get any characters.
Bookmarks