Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some minor problems with xc8 test version
02-05-2016, 10:52 AM,
#1
Some minor problems with xc8 test version
I installed IDE v12 on a linux machine and noticed that you can't use xc8 if you do not install sdcc compiler as well.
You get a message like no compiler found...

Furthermore the delay function seems not work correctly. The delay is ~3 times shorter.
There is a note in the changelog but it still seems to be not ok.

- 2016-04-11 fixed p8/delay for XC8 and SDCC

How can I check if I have the latest version? (installed it Friday 29.04)




Not xc8 related, but there is a difference between the diagram for pinguino_PIC18F4550
http://wiki.pinguino.cc/images/a/aa/PIC1...iagram.png

and the pin.h:
Code:
/**********************************************************************
334    #elif defined(PINGUINO4455) || defined(PINGUINO4550)
**********************************************************************
   
   #define A4          29   ??? should be 12 ???
   #define RUNLED      29
   #define LED1        29   29 seems to be C2 not A4
   #define USERLED     29
   #define PWM1        12
   #define PWM2        11
Reply
06-05-2016, 02:27 AM,
#2
RE: Some minor problems with xc8 test version
(02-05-2016, 10:52 AM)vloki_ Wrote: I installed IDE v12 on a linux machine and noticed that you can't use xc8 if you do not install sdcc compiler as well.
You get a message like no compiler found...

Furthermore the delay function seems not work correctly. The delay is ~3 times shorter.
There is a note in the changelog but it still seems to be not ok.

- 2016-04-11 fixed p8/delay for XC8 and SDCC

How can I check if I have the latest version? (installed it Friday 29.04)




Not xc8 related, but there is a difference between the diagram for pinguino_PIC18F4550
http://wiki.pinguino.cc/images/a/aa/PIC1...iagram.png

and the pin.h:
Code:
/**********************************************************************
334    #elif defined(PINGUINO4455) || defined(PINGUINO4550)
**********************************************************************
   
   #define A4          29   ??? should be 12 ???
   #define RUNLED      29
   #define LED1        29   29 seems to be C2 not A4
   #define USERLED     29
   #define PWM1        12
   #define PWM2        11

you are correct the timing using the XC8 is faster than SDCC .
Reply
09-05-2016, 10:05 AM,
#3
RE: Some minor problems with xc8 test version
Sorry, above I posted something odd.
The pinning should be in the opposite way.
USERLED is defined as 29 and should be 12!

This comes from that I'm posting from a windows computer while playing around
on Linux because on widows I got installation errors...

About the wrong delay timing for xc8. I wonder why not simply use the xc8 build in functions!
How and where could I implement this?
Played around a little bit with with delay.pdl and delay.c but got strange errors only.
Seems I have no clue how all this fits together ;-)

Today may be I have time the study the documentation "How can I make libraries for Pinguino?"
Hope this helps...

In the meantime I got v12 and xc8 running on windows as well (will post in other thread)
and this makes things a little more easy I hope. (two big LCD >20" here instead of one 10")
Reply
09-05-2016, 11:32 AM,
#4
RE: Some minor problems with xc8 test version
(09-05-2016, 10:05 AM)vloki_ Wrote: About the wrong delay timing for xc8. I wonder why not simply use the xc8 build in functions!
How and where could I implement this?
OK, I see it is not that simple.
With such high clock frequencies (like 48MHz) the __delay_ms() works up to 16ms only :-(
Reply
09-05-2016, 03:17 PM,
#5
RE: Some minor problems with xc8 test version
Just noticed that reason for the shorter delay when using xc8 is that the #ifdef _XC8_ seems not to work.
When I add it manually (#define _XC8_) in blink.pde the delay(500) is ~930ms. (Before it was  ~180ms)

Changing the code for Delayms() in delayms.c to
Code:
void Delayms(u16 ms)                            // 4 cycles (incl. return)
{
   u16 d1ms;
#ifdef _XC8_
   #define _XTAL_FREQ 48000000
   for(d1ms = 0; d1ms<ms; d1ms++)
       __delay_ms(1);
#else
   u8  dloop1, dloop2;
   u8  d1, d2, d3;
   ...
#endif
}
it is almost perfect.
Reply
09-05-2016, 04:32 PM,
#6
RE: Some minor problems with xc8 test version
(09-05-2016, 03:17 PM)vloki_ Wrote: Just noticed that reason for the shorter delay when using xc8 is that the #ifdef _XC8_ seems not to work.
_XC8_ has to be __XC8__ ? (was possibly wrong in delayms.c)
Reply
10-05-2016, 09:51 AM,
#7
RE: Some minor problems with xc8 test version
Hi vloki,
You're right, I will update the _XC8_ to __XC8__. Thank you.
I'm still looking for the perfect delay routine that would work for all the CPU frequencies (not only 48MHz) with the 2 compilers.
That's why I don't use the Microchip built-in __delay_ms() macro and tried to generate the same amount of cycles for the compilers.
Any help appreciated ;-)
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
10-05-2016, 09:13 PM,
#8
RE: Some minor problems with xc8 test version
Error found and fixed.
Now SDCC and XC8 should have the same delay.
Please update your testing copy.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)