Hi,
I'm still playing with XC8, and thought I'd port the Ringtone player from to play on an 8 pin enhanced 12F1840.
I first moved the code to XC8, and confirmed it worked on a 16F876, then altered the timing values for 8MHz rather than 20MHz (so as to use the internal oscillator on the 12F1840), again confirming it worked on the 876.
So next I moved to the 12F1840, altering the TONE define to RA0, and the TRIS statement accordingly - but while it compiles fine, all you get out is a few clicks. With the scope on RA0 it appears to be getting the timing from TMR0, but not the frequency pules from TMR1?. I've tried various of the RA pins, and none of them work.
So this afternoon I tried a 16F1827 instead, starting from the working 876 code - just altered the config and set the oscillator to 8MHz, and it worked perfectly.
So next I tried RA0 - same result as the 12F1840 - so I though perhaps it didn't like PORTA?, so tried RB1 instead - same result
As I understand the program it uses the TONE definition to toggle the output port, so why will it only work with RB0? - I can't help but think I'm missing something somewhere?.
Any ideas? - I've attached the code I'm using, complete with commented out changes for TONE and TRIS