I forgot to say:
The noise on PORTC.0 is present during the off pulse
I forgot to say:
The noise on PORTC.0 is present during the off pulse
After reading another thread I added
LOW PORTC.0
just before the loop and this seemed to solve my problem!
Why would that be?
Isn't TRISC %11111000 supposed to set PORTC.0 as an output?
Hello Passion1,
Yes TRISC <font color=red><b>=</b></font color>%11111000 will set RC0 as an output
LOW PORTC.0 is a RMW operation and the data sheet advises not to do this on portC of this chip. RC.0 shares TMR1clockin and osc functions so you want to disable those if using as a standard I/O so:
T1CON.0 = 0 'disable timer 1
CCP1CON=0 ' disable capture compare module which works with timer 1
Datasheet SEC. 4.3
"Since the TRIS bit override is in effect while peripheral is enabled, read-modify-write instructions (BSF, BCF, XORWF) with TRISC as destination should be avoided."
Last edited by Archangel; - 14th February 2009 at 19:23.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Joe
Thank you!
I used
T1CON.0 = 0 'disable timer 1
CCP1CON=0 ' disable capture compare module which works with timer 1
and that solved my problem completely!
I have some doubt about it... @POR, Timer1 is already off, CCP as well.
What you experiment is indeed an RMW issue. You don't want to write to successive output bit by bit, this will cause some problem one day or another, and faster your OSC is, more chance you have to see it happen.
What you want to do is to write to the WHOLE PORT at once instead of single bits.
Here:
PORTC=7
PORTC=0
Goto Here
Use shadow register, modify it, then dump it to your specific PORT, that's my suggestion.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi, Passion
What Kind of load do you have on portC.0 ???
Here, your signal might not be far from ... ~ 700 kHz ( at first sight ! 555 Khz ... at second sight )
Alain
Last edited by Acetronics2; - 15th February 2009 at 14:22.
************************************************** ***********************
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 " !!!
*****************************************
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks