Menu

problem 16F88 and usart.h

Help
2009-09-12
2013-05-30
  • alejandro1957

    alejandro1957 - 2009-09-12

    When I compile this code :
    #chip 16f88,20
    #config OSC=HS,WDT_OFF,PWRTE_ON,MCLR_ON,CP_OFF
    #include <SSP_I2C_PicSlave.h>                  'libreria I2C slave
    #include <usart.h>                             'libreria USART
    '''''''''''''''''''''''''''''''''' Setup USART module '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    #define USART_BAUD_RATE 600                    'Configuro Vicky a 600 baud de transmiciòn

    #define USART_BLOCKING
    '''''''''''''''''''''''''''''''''' Setup SSP module '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    #define Slv_Comunicacion b'00111100'           'Configuro Pic_Slave I2C_address
    #define BufferLen 1                            'Cuantos byte en recepciòn para activar el interrupt
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Dim RxBuffer(RxBufferSize) 
    DIR PORTA b'00000'                             'Puerto A todos out
    DIR PORTB b'00010110'                          'Puerto B 1/2/4 in,los demas out
    PORTA=b'00000'                                 'Puerto A todos down
    PORTB=b'00000000'                              'Puerto B todos down
    InitUSART                                      'Setup USART
    InitSSP                                        'Configuraciòn registros SSP y activar el interrupt 
    Main:
       Interrupt                                   'En caso de interrupt
       TestLed = RxBuffer(1)                       'Recibe byte del Master
       HserPrint "Test"

       HserSend TestLed
       HserPrint "#®"

       wait 10 ms
       Rotate TestLed Right
       PortB.0 = Status.C 
       Rotate TestLed Right
       PortB.3 = Status.C 
       Rotate TestLed Right
       PortB.6 = Status.C 
       Rotate TestLed Right
       PortB.7 = Status.C 
       goto Main

    give me error :
    Strumento in esecuzione: gcbasic

    Great Cow BASIC (0.9 16/6/2009)

    Compilando /home/alejandro/Scrivania/Robot/Rover/Firmware/ver_16f88 …
    Segmentation fault

    Uscito: 35584

     
  • alejandro1957

    alejandro1957 - 2009-09-12

    Sorry, I mistyped

     
  • alejandro1957

    alejandro1957 - 2009-09-12

    solved, thanks to all.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.