Originally posted by SaltyDog
View Post
The port will be minimal, a few bit defines and PWM routine changes. Just write direct to the registers for timers or PWM.
MikroC uses a complete definition of register and bit
for instance ADCON0.ADON = 1; // ADC on
In XC8 it would be ADON=1;
So for the timer setup it would be something like this;
// Timer0 timebase - for sound generation
PS0 = 1;
PS1 = 1;
PS2 = 0; //prescaler / 16
PSA = 0;
TMR0CS = 0; // FOSC / 4 --> 8 MHz
TMR0IE = 1; // timer0 interrupt enable
I did port the Pickini 4 project to XC8 some time ago and had it working on a PIC18F1829 no worries.
Thought I would be smart and use the MCC setup which also worked...but then when making some changes one day, a software update occured and it crashed and the MCC file became corrupt, lost that part although the main C code was fine.
Will share the code when I get back to tidying it up but I have paying work and a lot of other projects lined up so might be a while.
Can send it via private mail if you like as a reference but for general sharing here it would add confusion and I would much rather wait and have it completed and share it as a complete project as my take on the Pickini design.
Cheers
Mdtoday
Leave a comment: