I don't know if it's really a bug:
The code for lines (59/60)
PORTB = g_vcval[0]; // output DEBUG
CCPR1L = g_vcval[0]; // output PWM
is not generated; the output isn't run.
When change lines 59/60 to:
PORTB = g_vcval[0]; // output DEBUG
CCPR1L = PORTB; // output PWM
the code is generated and runs fine.
version:
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.6.0 #4309 (Jul 28 2006) (MINGW32)
Cheers
labolida@terra.com.br
source c code
Logged In: YES
user_id=1115835
Originator: NO
Well, 2.6.0, r4309 is ancient history... The attached code compiles fine (though freq.c and wave.c are missing...) with SDCC 2.6.4, r4570.
Please update your installation and try again.
Regards,
Raphael
Logged In: YES
user_id=1694633
Originator: NO
Thanks for your follow up.
The latest version in Source Forge is 2.6.0, how I can obtain the 2.6.4.?
Thanks in advance
Miguel Labolida
Logged In: YES
user_id=1115835
Originator: NO
Either use one of the snapshots from http://sdcc.sourceforge.net/snap.php#Windows (most recent one is 2.6.3, r4543 from 31-12-2006, though), or grab the sources from the subversion repository and compile them yourself. As you seem to use SDCC in Windows/MinGW, the snapshot approach is probably preferrable. That revision should be fine for the moment, as I did not change the PIC14/PIC16 ports much this year so far.
Regards,
Raphael
Logged In: YES
user_id=1115835
Originator: NO
Wrong diagnosis: The bug lies in the (known) faulty pcode optimization still enabled by default...
Until this is fixed, use `sdcc -mpic14 -p[whatever] --no-pcode-opt [...]' to prevent this overly aggressive optimization from breaking your code.
Regards,
Raphael