Announcement

Collapse
No announcement yet.

only reproduce one message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • only reproduce one message

    Hello i'm from Venezuela, sorry for my english!!!I recently bought the somo-14d and i already have a few problems. I working with the PIC16F88, and a crystal of 14.7456Mhz. And the code is in assembler (.asm).Just like you said i'm try to recreate the serial data timing and the wave form that shows in the datasheet, with delays and bit banging like i think you called!
    NOTE: I recorded the voice messages zero, one, two, three,.....,ten, and i put the same name in the microsd card to identify the messages (0x0000,0x0001,0x002,0x0003,......,0x0010), and i tested in the Key Mode and is perfect.

    The problem is that for how much that i try to reproduce with another commands always reproduce the same message (0x0000), i mean if i send the command 0x0001 always reproduce the sound "zero" message, command 0x0002 reproduce the sound "zero" message, command 0x0003 reproduce the sound "two" message, and repeat randomly.
    That happens when connect and disconnect de power supply and push the button once, because when i connect the power supply and push the button the first time reproduce the sound "zero" like i already says, then i'll wait for the busy led turn off so push it again the button and the busy led turn on for another period of time (longer that the time of the sound ) with not sound at all!!!
    please if you could help apreciated so much.Below is the code in assembler .asm, and i'm attach the circuit diagram.--------------------------------------------------------------------------- LIST P=16F88 INCLUDE __CONFIG _CONFIG1, 2F62 __CONFIG _CONFIG2, 0000
    CBLOCK 20H M N O AUX_W AUX_STATUS DATO_RX CONVERT DATO_I2C_HIGH DATO_I2C_LOW CONT_BYTE_HIGH CONT_BYTE_LOW DATO_AND
    ENDC
    ORG 00H GOTO INICIO
    INICIO CALL RETARDO1 ;1SEG DELAY CALL CONFIG_PUERTOS
    GOTO MAIN;-----------------------------------CONFIG_PUERTOS BCF STATUS,RP0 ; BCF STATUS,RP1 ;BANCO 0 CLRF PORTA CLRF PORTB
    BSF STATUS,RP0 ; BCF STATUS,RP1 ;BANCO 1 MOVLW B'00000000' MOVWF ANSEL MOVLW B'11101111' MOVWF TRISA MOVLW B'00000101' MOVWF TRISB
    BCF STATUS,RP0 ; BCF STATUS,RP1 ;BANCO 0




    RETURN;-----------------------------------MAIN BTFSC PORTB,0 ;BUTTON CALL REPRODUCIR GOTO MAIN

    REPRODUCIR
    style="white-spacere"> BTFSC PORTB,0 ;RELEASE BUTTON GOTO $-1
    BSF PORTB,7 ;LED GREEN; ******MENSAJE**********

    MOVLW 0x00 MOVWF DATO_I2C_HIGH MOVLW 0x00 MOVWF DATO_I2C_LOW CALL ENVIAR_DATO_16BITS ;send 16bits data
    CALL RETARDO1 ;1SEG DELAY
    BTFSC PORTA,0 ;SOMO-14D BUSY PIN GOTO $-1
    BCF PORTB,7 ;LED GREEN RETURN

    ENVIAR_DATO_16BITS ;send 16bits data; ***********************; ***** DATO 16BITS *****; *********************** BCF STATUS,RP1 BCF STATUS,RP0 ;BANCO 0
    MOVLW .8 MOVWF CONT_BYTE_HIGH MOVLW .8 MOVWF CONT_BYTE_LOW CLRF DATO_ANDite-spacere"> MOVLW B'10000000' MOVWF DATO_AND
    ; ******** START BIT **********
    BSF PORTB,4 ;SCL HIGH CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS BCF PORTB,4 ;SCL LOW CALL RET1mS ;3mS START BIT CALL RET1mS CALL RET1mS GOTO SEND_HIGH_BYTE; *********************************; *********************************
    SALTO_1 RRF DATO_AND,F ;SALTO = JUMPSEND_HIGH_BYTE MOVF DATO_AND,W ANDWF DATO_I2C_HIGH,W BTFSS STATUS,Z GOTO UNO CALL CEROSALTO_2 DECFSZcere"> CONT_BYTE_HIGH,F GOTO SALTO_1 GOTO SEND_LOW_BYTE

    SEND_LOW_BYTE CLRF DATO_AND MOVLW B'10000000' MOVWF DATO_AND GOTO $+2SALTO_3 RRF DATO_AND,F MOVF DATO_AND,W ANDWF DATO_I2C_LOW,W BTFSS STATUS,Z GOTO UNO_B CALL CEROSALTO_4 DECFSZ CONT_BYTE_LOW,F GOTO SALTO_3 GOTO STOP_BIT


    UNO
    BSF PORTB,1 ;SDA HIGH BCF PORTB,4 ;SCL LOW CALL RET100uS ;RET = DELAY CALL RET100uS BSF PORTB,4 ;SCL HIGH CALL RET100uS CALL RET100uS GOTO SALTO_2
    UNO_B BSF PORTB,1 ;SDA HIGH BCF PORTB,4 ;SCL LOW CALL RET100uS CALL RET100uS BSF TRISB,4 ;SCL HIGH CALL RET100uS CALL RET100uS GOTO SALTO_4
    CERO BCF PORTB,1 ;SDA LOW BCF PORTB,4 ;SCL LOW CALL RET100uS CALL RET100uS BSF PORTB,4 ;SCL HIGH CALL RET100uS CALL RET100uS RETURN
    STOP_BIT BCF PORTB,1 ;SDA LOW BCF PORTB,4 ;SCL LOW CALL RET50mS
    BSF PORTB,4 ;SCL HIGH CALL RET1mS CALL RET1mS ;3mS STOP BIT CALLn class="Apple-tab-span" style="white-spacere"> RET1mS BCF PORTB,4 ;SCL LOW CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS CALL RET50mS BCF PORTB,1 ;SDA LOW
    ; ******************************** RETURN ;-----------------------------------
    RET1mS
    MOVLW .6 MOVWF M MOVLW .250 MOVWF N DECFSZ N GOTO $-1 DECFSZ M GOTO $-5 RETURN
    ;-----------------------------------
    RET10mS
    MOVLW .52 MOVWF M MOVLW .237 MOVWF N DECFSZ N GOTO $-1pre"> DECFSZ M GOTO $-5 RETURN;-----------------------------------
    RET50mS
    MOVLW .255 MOVWF M MOVLW .240 MOVWF N DECFSZ N GOTO $-1 DECFSZ M GOTO $-5 RETURN
    ;-----------------------------------
    RET100uS MOVLW .1 MOVWF M MOVLW .140 MOVWF N DECFSZ N GOTO $-1 DECFSZ M GOTO $-5 RETURN;-----------------------------------RETARDO1 MOVLW .18 MOVWF O MOVLW .255 MOVWF M MOVLW .255 MOVWF Nre"> DECFSZ N GOTO $-1 DECFSZ M GOTO $-5 DECFSZ O GOTO $-9 RETURN;-----------------------------------RETARDO2
    MOVLW .200 MOVWF M MOVLW .255 MOVWF N DECFSZ N GOTO $-1 DECFSZ M GOTO $-5 RETURN;-----------------------------------
    END

  • #2


    At a quick glance I can only see one point that you set an address

    MOVLW 0x00 MOVWF DATO_I2C_HIGH MOVLW 0x00 MOVWF DATO_I2C_LOW
    please try converting the 4DGL example code to ASM

    Please note also that SOMO is not I2C, not sure about your register naming conventions

    Hvea a look here for some C code that should help you on your way
    http://forum.sparkfun.com/viewtopic.php?f=14&t=21388
    Regards,
    Dave

    Comment

    Working...
    X