Hi our there,

I've just started with sdcc, and I found it
fine but I have some issues on it.

SDCC issues:

sdcc hangs on Win98SE during compilation.
(proved on a desktop, and a notebook machine)
gpasm is used as an assembler, but it
did not run yet  at the moment of crash.

sdcc --help worked :-)

Environment:

MINGW and MSYS shell.
sdcc from  sdcc-20061205-4501-setup.exe
gpasm from gputils-0.13.4-1.exe

SDCC Ports:

For PIC182445,PIC18F2550,PIC18F445 and PIC18F4550 devices
(PIC18F4550 has been tested) I found the following issues:

1. /sdcc/include/pic16/pic18f4550.h
  This family has TXCKP instead of SCKP in BAUDCON
  I understand. It's kept SCKP for compatibility, but
  the next bit - RXDTP - has to be named - for RX polarity.

2. /sdcc/lib/src/pic16/libio/usart/uopen.c
  I see that this is for compatibility too, but
  do not forget the settings below:

  TRISCbits.TRISC6   = 1;
  TRISCbits.TRISC7   = 1;

  Consider to assign SPBRGH as well, not just SPGRG.
  Here's why:

  /* Baud rates for BRGH=1 BRG16=1 OSC=48MHz  */
  /*    300 -> 39999      */
  /*    600 -> 19999      */
  /*   1200 ->  9999      */
  /*   2400 ->  4999      */
  /*   4800 ->  2499      */
  /*   9600 ->  1249      */
  /*  19200 ->   624      */
  /*  38400 ->   311      */
  /*  57600 ->   207      */
  /* 115200 ->   103      */
  SPBRGH      =    0;
  SPBRG       =  207;  /* to 57600 */

  In the last case, rates below 57600 requires SPBRGH as well
  (311 for 38400 :-)
  For your convenience, the init sequence of mine can be found
  in the attached archive.

3. /sdcc/lib/src/pic16/startup
  Since startup code does not reflect to linker script

CODEPAGE NAME=vectors START=0x800 END=0x829 PROTECTED
  CODEPAGE   NAME=page       START=0x82A          END=0x7FFF

  or --ivt-loc=0x800 either we had to do something...

  When I am using BRAND  USB boot-loader, I have to
  prep the following as a workaround:

  /**/
  /* - Special remapping of vectors to 800 - tweaking crt0 */
  /*   for AN956 USB boot loader                           */
  /**/
  #pragma code _reset 0x000800
  void _reset( void ) __naked
  {
      __asm
      EXTERN __startup
      goto __startup
      __endasm;
  }
  #pragma code _high_ISR  0x000808
  void _high_ISR( void ) __naked
  {
      __asm
      retfie
      __endasm;
  }
  #pragma code _low_ISR  0x000818
  void _low_ISR( void ) __naked
  {
      __asm
      retfie
      __endasm;
  }

  It seems quite ugly.. Do you have better solution?

4. Am I right that stdio is far far from beta?
  Are there any tricks to bring up v(f)printf?
I found only itoa to work at maximum...
  Here's the code of struggle:

  /* - First approach, without calling capability */
  /*   PASSED
  while(1)
    {
    while(!TXSTAbits.TRMT); TXREG='A';
    while(!TXSTAbits.TRMT); TXREG='B';
    while(!TXSTAbits.TRMT); TXREG='C';
    while(!TXSTAbits.TRMT); TXREG='D';
    while(!TXSTAbits.TRMT); TXREG='a';
    while(!TXSTAbits.TRMT); TXREG='b';
    while(!TXSTAbits.TRMT); TXREG='c';
    while(!TXSTAbits.TRMT); TXREG='d';
    while(!TXSTAbits.TRMT); TXREG='\r';
    while(!TXSTAbits.TRMT); TXREG='\n';
    }
  */
/* - Second approach, with calling capability */
  /*   crt0 _startup code provides us STACK       */
  /*   PASSED
  while(1)
    {
    i++;
    while(!TXSTAbits.TRMT);
    TXREG=(i%10)+0x30;
    }
  */
/* - Third approach, with calling stream lib. */
  /*   PASSED
  while(1)
    {
    __stream_usart_putchar(((i++)%10)+0x30);
    }
  */
  /* - Fourth approach, with calling usart lib.   */
  /*   PASSED
  #define puts usart_puts
  while(1)
    {
    puts( "==stdinout test==\r\n" );
    }
  */
  /* - Fourth attempt, call itoa --> PASSED       */
#define puts usart_puts
  while(1)
    {
    itoa( i++, buff, 10 );
    puts( buff );
    puts( "\r" );
    }
/* - Fifth attempt, call sprintf --> Failed */
  /*
  #define puts usart_puts
  while(1)
    {
    sprintf( buff, "->%d\r\n", i++ );
    puts( buff );
    }
  */
  /* - Sixth  attempt, any (tiny, etc..  printf  --> Failed   */
  /*
  stdout=STREAM_USART;
  while(1)
    {
    printf( "==>%d\r\n", i++ );
    }
  */
5. Documentation issues on PIC 16 port
  /sdcc/doc/sdccman.pdf

  --stack-model should be --pstack-model

  Best regards
Gyorgy Horvath
  horvaath tmit bme hu

Attachment: stdinout-070109.tar.gz
Description: application/gzip

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to