PIC16F628A problems - It simply seems to doesn't work

Discussion in 'Embedded Systems and Microcontrollers' started by nolfolk, Jun 9, 2010.

  1. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    Hi forum. I'm new ( in this forum and at microcontrollers ).

    I'm having trouble trying to do my first project: let a led lights up :(

    I'm using MPLab IDE 8.46 to program and simulate and IC-Prog 1.05D to program ( to the chip )

    I'll put my source code and my schema, if someone help me i'll be greatful

    Code ( (Unknown Language)):
    1.  
    2. ; INCLUDE OBRIGATORIO
    3. #INCLUDE <P16F628A.INC>
    4.  
    5. ; CONFIGURACOES
    6. __CONFIG _BOREN_ON&_CP_ON&_DATA_CP_OFF&_PWRTE_ON&_WDT_OFF&_LVP_OFF&_MCLRE_ON&_XT_OSC
    7.  
    8. ; BANCOS DE MEMORIA
    9. #DEFINE BANCO_0 BCF STATUS,RP0 ; BANCO DE MEMORIA 0
    10. #DEFINE BANCO_1 BSF STATUS,RP0 ; BANCO DE MEMORIA 1
    11.  
    12. ; CONSTANTES DE SAIDA
    13. #DEFINE LED PORTA,0 ; LED
    14. #DEFINE LED2 PORTB,0 ; LED
    15.  
    16. ; RESET
    17. ORG 0x00
    18. GOTO INICIO
    19.  
    20. ; INTERRUPCOES
    21. ORG 0x04
    22. RETFIE ; RETORNA AO PONTO INTERROMPIDO
    23.  
    24. INICIO
    25.     BANCO_1
    26.     MOVLW B'00000000'
    27.     MOVWF TRISA ; SETA PORTA COMO OUTPUT
    28.     MOVWF TRISB ; SETA PORTB COMO OUTPUT
    29.     MOVLW B'10000000'
    30.     MOVWF OPTION_REG
    31.     MOVLW B'00000000'
    32.     MOVWF INTCON
    33.     BANCO_0
    34.     MOVLW B'00000111'
    35.     MOVWF CMCON ; CONFIGURA RA3:RA0 COMO I/O
    36.     CLRF PORTA
    37.     CLRF PORTB
    38.    
    39. MAIN
    40.     BSF LED ; ACENDE O LED
    41.     BSF LED2 ; ACENDE O LED
    42.     GOTO MAIN
    43.    
    44. END
    45.  
    And my protoboard schema:
    http://img199.imageshack.us/i/lilod.png/

    I'm using 4 1.5V batteries to gain ~4.6V as feeding.

    well... that's it, i'm kinda furstrated because I am working on that the hole week, and I can't figure what's wrong :(

    Please help ... I don't know what else can I do :(
     
  2. bobfrancisko

    New Member

    Dec 10, 2009
    1
    0
    Man, if you don't put a resistor to limit the current to led, maybe you screw the led an pic, too.
     
  3. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    I can't see anything too obvious apart from the missing LED resistor. I'm not sure if RA6 and 7 have to be set as inputs for the external crystal to work.
    A 1K resistor is recommended between MCLR and VDD but I'm not sure if it will make any difference.
    You could disconnect the crystal and try _INTRC_OSC_NOCLKOUT instead of _XT in the config.
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    As mentioned before you should put resistor between the output and LED. About 470 ohm should be a OK value. In the start I will also recommend using internal OSC and MCLR internally tied to VDD. And turn all the fancy functions OFF.
    I have made a program you can try. It will blink the PORTA bit 0. I do not have any 16f628A so I have not tested it. But it compiles.
    Code ( (Unknown Language)):
    1.  
    2. ;;==========================================================================
    3. ;;
    4. ;;       Configuration Bits
    5. ;;
    6. ;;==========================================================================
    7. ;
    8. ;_BODEN_ON                    EQU     H'3FFF' ;Backwards compatability to 16F62X
    9. ;_BODEN_OFF                   EQU     H'3FBF' ;Backwards compatability to 16F62X
    10. ;_BOREN_ON                    EQU     H'3FFF'
    11. ;_BOREN_OFF                   EQU     H'3FBF'
    12. ;_CP_ON                       EQU     H'1FFF'
    13. ;_CP_OFF                      EQU     H'3FFF'
    14. ;_DATA_CP_ON                  EQU     H'3EFF'
    15. ;_DATA_CP_OFF                 EQU     H'3FFF'
    16. ;_PWRTE_OFF                   EQU     H'3FFF'
    17. ;_PWRTE_ON                    EQU     H'3FF7'
    18. ;_WDT_ON                      EQU     H'3FFF'
    19. ;_WDT_OFF                     EQU     H'3FFB'
    20. ;_LVP_ON                      EQU     H'3FFF'
    21. ;_LVP_OFF                     EQU     H'3F7F'
    22. ;_MCLRE_ON                    EQU     H'3FFF'
    23. ;_MCLRE_OFF                   EQU     H'3FDF'
    24. ;_RC_OSC_CLKOUT               EQU     H'3FFF'
    25. ;_RC_OSC_NOCLKOUT             EQU     H'3FFE'
    26. ;_ER_OSC_CLKOUT               EQU     H'3FFF' ;Backwards compatability to 16F62X
    27. ;_ER_OSC_NOCLKOUT             EQU     H'3FFE' ;Backwards compatability to 16F62X
    28. ;_INTOSC_OSC_CLKOUT         EQU     H'3FFD'
    29. ;_INTOSC_OSC_NOCLKOUT         EQU     H'3FFC'    
    30. ;_INTRC_OSC_CLKOUT         EQU     H'3FFD' ;Backwards compatability to 16F62X
    31. ;_INTRC_OSC_NOCLKOUT      EQU     H'3FFC' ;Backwards compatability to 16F62X
    32. ;_EXTCLK_OSC                  EQU     H'3FEF'
    33. ;_HS_OSC                      EQU     H'3FEE'
    34. ;_XT_OSC                      EQU     H'3FED'
    35. ;_LP_OSC                      EQU     H'3FEC'
    36.  
    37. #include <p16F628a.inc>
    38.     __config (_INTRC_OSC_NOCLKOUT & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF  & _CP_OFF & _BOREN_OFF & _BODEN_OFF & _DATA_CP_OFF   )
    39. ; Note using defualt setting for internal OSC=4MHz
    40.     cblock 0x20
    41. Delay1                   ; Define two file registers for the
    42. Delay2                   ; delay loop
    43.      endc
    44.      org 0
    45. Start:
    46.  CLRF PORTA   ;Initialize PORTA by setting output data latches
    47.  MOVLW 0x07   ;Turn comparators off and
    48.  MOVWF CMCON  ;enable pins for I/O;functions
    49.  banksel TRISA  ;select Register Page 1
    50.  MOVLW 0x10   ;Value used to initialize data direction
    51.  MOVWF TRISA  ;Set RA<4:0> as outputs TRISA<5> always read as ‘1’ TRISA<7:6> depend on oscillator mode    
    52.     banksel PORTA   ; back to Register Page 0 See MPLAB help for banksel description
    53. MainLoop:
    54.      bsf       PORTA,0             ; turn on LED
    55. OndelayLoop:
    56.      decfsz    Delay1,f            ; Waste time.  
    57.      goto      OndelayLoop         ; The Inner loop takes 3 instructions per loop * 256 loopss = 768 instructions
    58.      decfsz    Delay2,f            ; The outer loop takes and additional 3 instructions per lap * 256 loops
    59.      goto      OndelayLoop         ; (768+3) * 256 = 197376 instructions / 1M instructions per second = 0.197 sec.
    60.                                    ; call it a two-tenths of a second.
    61.  
    62.      bcf       PORTA,0             ; Turn off LED
    63. OffDelayLoop:
    64.      decfsz    Delay1,f            ; same delay as above
    65.      goto      OffDelayLoop
    66.      decfsz    Delay2,f
    67.      goto      OffDelayLoop
    68.      goto      MainLoop            ; Do it again...
    69.      end
    70.  
    71.  
    72.  
     
  5. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    Thanks for the reply :)

    > Man, if you don't put a resistor to limit the current to led, maybe you screw the led an pic, too.

    That's true ? :( how the resistor in a out pin of the microcontroller would screw the microcontroller itself ? :(
    I hope my microcontroller is fine. Well, he still reads and writes, that's a clue that he's still working ?
    I don't understand why I have to put a resistor there, but ok, I'll buy one today and test it...

    --

    > I can't see anything too obvious apart from the missing LED resistor. I'm not sure if RA6 and 7 have to be set as inputs for the external crystal to work.
    A 1K resistor is recommended between MCLR and VDD but I'm not sure if it will make any difference.
    You could disconnect the crystal and try _INTRC_OSC_NOCLKOUT instead of _XT in the config.

    The resistor again :S I'll buy it today, it may be that, then... I don't understand why.
    I thought that maybe I was supose to put RA6 and RA7 as inputs ou CLKIn as input and CLKOut as output, but I'm not sure. If things remain wrong, I'll try that.

    Again with resistors x_x 1K resistor to MCLR, ok, I'll try that too. I'll buy a bunch of resistors xD someone have any explanation for all that resistors ? I don't understand why they are necessary õ.o

    I'll try without _XT too, as soon as I buy the resistors.

    --

    > As mentioned before you should put resistor between the output and LED. About 470 ohm should be a OK value. In the start I will also recommend using internal OSC and MCLR internally tied to VDD. And turn all the fancy functions OFF.
    I have made a program you can try. It will blink the PORTA bit 0. I do not have any 16f628A so I have not tested it. But it compiles.

    Thanks! I'll buy the resistors and then I'll try your solution :D
    How do I tie the MCLR to the VDD internally ?



    Thanks everyone, I think maybe I can fix my lil' project :)
    Thanks!
     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Just use :
    _MCLRE_OFF in the config instead of _MCLRE_ON
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You do have downloaded the datasheet ;) Well let us assume you have done that. A very important section to read is 14.0 SPECIAL FEATURES OF THE CPU. Setting the configuration bit wrong may cause strange MCU behaviour. Like it do not do anything. Then you are in the electronics shop get some(a lot) 100nF decoupling capacitors also. Never build anything without it
    http://en.wikipedia.org/wiki/Decoupling_capacitor
     
  8. wannaBinventor

    Member

    Apr 8, 2010
    179
    4
    For in circuit serial programming (ICSP), I use a diode between MCLR and Vdd. I've also found that if my PicKit2 is plugged into the circuit with the pins attached for programming, I have to disconnect the wire running to MCLR when I am trying to run on battery power alone.
     
  9. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    Nvm, I Think i broke the MCU ...
    I try to write on it, but it keep givin me the error : "verificação falhou no endereço 0000h!" ("verify error at address 0000h")

    [​IMG]
     
  10. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    Oooops now it worked =D I've changed _CP_ON to _CP_OFF and it worked fine :D

    Code Protection sux ? :D

    I'll try to put it on the protoboard and see what happens :D
     
  11. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    I tryied that:

    http://img824.imageshack.us/i/test002.png/

    Code ( (Unknown Language)):
    1.  
    2. ; INCLUDE OBRIGATORIO
    3. #INCLUDE <P16F628A.INC>
    4.  
    5. ; CONFIGURACOES
    6. __CONFIG  _BOREN_ON&_CP_OFF&_DATA_CP_OFF&_PWRTE_ON&_WDT_OFF&_LVP_OFF&_MCLRE_OFF&_INTRC_OSC_NOCLKOUT
    7.  
    8. ; BANCOS DE MEMORIA
    9. #DEFINE BANCO_0 BCF STATUS,RP0 ; BANCO DE MEMORIA 0
    10. #DEFINE BANCO_1 BSF STATUS,RP0 ; BANCO DE MEMORIA 1
    11.  
    12. ; CONSTANTES DE SAIDA
    13. #DEFINE LED PORTA,0 ; LED
    14.  
    15. ; RESET
    16. ORG 0x00
    17. GOTO INICIO
    18.  
    19. ; INTERRUPCOES
    20. ORG 0x04
    21. RETFIE ; RETORNA AO PONTO INTERROMPIDO
    22.  
    23. INICIO
    24.     BANCO_1
    25.     MOVLW B'00000000'
    26.     MOVWF TRISA ; SETA PORTA COMO OUTPUT
    27.     MOVLW B'00000000'
    28.     MOVWF INTCON ; DESLIGA CHAVE GERAL DE INTERRUPCAO
    29.     BANCO_0
    30.     MOVLW B'00000111'
    31.     MOVWF CMCON ; CONFIGURA RA3:RA0 COMO I/O
    32.     CLRF PORTA
    33.    
    34. MAIN
    35.     BSF LED ; ACENDE O LED
    36.     GOTO MAIN
    37.    
    38. END
    39.  
    But didn't work :(
    Any sugestion ?
     
  12. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    t06afre, I tryied your code, didn't worked.

    I just realized:

    If I write things on the MCU (with _CP_OFF ) and then I read it, the configuration comes DIFERENT!
    For example, Oscilator that was IntRC I\O comes LP, CP gone OFF comes ON, MCRL goes OFF comes ON...
    That's normal behavior ?

    I'm using IC-Prog 1.05D, for PIC16F628A.
     
  13. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    What do you use as programmer. Not software but the programming hardware. It looks to me that your programmer hardware has not done the job. Are you using a USB to serial converter for your programmer? Are you also sure your programming hardware works as it should? If your budget allows it I would recommend a PICKIT 2.
    Edit: I also tested the program on a 16f690. I had do modify the setup part some. But the mainloop was the same. No problems at all
     
    Last edited: Jun 11, 2010
  14. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    In other forum, a guy realised that I put _cp_on and WROTE in the MCU.
    He said that as I did so, I CANT write on the MCU anymore... Is that true ? So then I have to buy another MCU because of that ? :(

    I realy did that, by mistake, but, just because I did it, I cant clean up / rewrite the MCU anymore ? :(

    I did not build the programmer, I bought it online.
    I used him to program a PIC16F84A once, and it did fine, I made a 7 segment display count from 0 to 9. And I didn't used any capacitors, just 7 resistors for the segment display, because once I turned it directly in the MCU and it "burned" :p

    The programmer is SERIAL and it is a "JDM Programmer". A PICKIT 2 is way to expensive where I live. a JDM is like R$24,00 while a PICKIT2 is R$90,00 to R$150,00 !
     
  15. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    As I read the manual, I think the guy was mistaken. The manual says:
    "Only a Bulk Erase function can set the CP
    and CPD bits by turning off the code
    protection. The entire data EEPROM and
    Flash program memory will be erased to
    turn the code protection off."

    :D So I still can write on my MCU! Great!

    Maybe is something on the IC-Prog itself... I'll try to clear the MCU and start all over, with my code, most simple as I can. Then I'll post here what I'm doing.
    Be Right Back.
     
  16. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Try this. The problem with serial port programmers is that they might not work and it depends solely on the hardware of the serial port on your PC or Laptop. Serial COM port on very old PC usually works but most laptop COM port won't.
    [​IMG]
     
  17. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Your chip can be reprogrammed by the "bulk erase" method only
    The PICKITS can do this, and also other more advanced programmers. Perhaps you know someone with such a programmer.
     
  18. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    Here's what I did:

    - Put the MCU on the Programmer.
    - The hardware is a TecTrony PicStarS for Serial Port. The TecTrony site is off (www.tectrony.com) and I don't have the schematic of the programmer :(
    But I Still have the manual (in portuguese)
    - I'm using Windows7, so, I'm openning IcProg in compatibility mode to WindowsXP SP 3, and execute it as ADMINISTRATOR.
    - Also, as I'm using windows 2000 or later, I have the icprog.sys file, as required
    - In IC-Prog I selected PIC 16F628A as my PIC.
    - In configurations>hardware I put:
    Programmer: JDM Programmer
    Ports: Com1
    Interface: Windows API
    Comunication: [nothing selected]
    I/O Delay: 20

    As I have in the ScreenShot:
    [http://img710.imageshack.us/i/19590923.png/]

    - Now I'll ERASE ALL MCU
    - Devide is erased: [http://img252.imageshack.us/i/16550597.png/]
    - Now I'll READ ALL
    - Done. Screenshot here: [http://img816.imageshack.us/i/19668768.png/] and here [http://img704.imageshack.us/i/53159749.png/]

    - Now, in MPLab IDE I got my project and made sure the device [http://img693.imageshack.us/i/97809405.png/] and that the configurations are set by ME [http://img251.imageshack.us/i/24449746.png/]
    - Then I compile the project.
    - HERE IS THE CODE:

    Code ( (Unknown Language)):
    1.  
    2. ; INCLUDE OBRIGATORIO
    3. #INCLUDE <P16F628A.INC>
    4.  
    5. ; CONFIGURACOES
    6. __CONFIG _BOREN_OFF&_CP_OFF&_DATA_CP_OFF&_PWRTE_OFF&_WDT_OFF&_LVP_OFF&_MCLRE_OFF&_INTRC_OSC_NOCLKOUT
    7.  
    8. ; BANCOS DE MEMORIA
    9. #DEFINE BANCO_0 BCF STATUS,RP0 ; BANCO DE MEMORIA 0
    10. #DEFINE BANCO_1 BSF STATUS,RP0 ; BANCO DE MEMORIA 1
    11.  
    12. ; CONSTANTES DE SAIDA
    13. #DEFINE LED PORTA,0 ; LED
    14.  
    15. ; RESET
    16. ORG 0x00
    17. GOTO INICIO
    18.  
    19. ; INTERRUPCOES
    20. ORG 0x04
    21. RETFIE ; RETORNA AO PONTO INTERROMPIDO
    22.  
    23. INICIO
    24.     BANCO_1
    25.     MOVLW B'00000000'
    26.     MOVWF TRISA ; SETA PORTA COMO OUTPUT
    27.     MOVLW B'00000000'
    28.     MOVWF INTCON ; DESLIGA CHAVE GERAL DE INTERRUPCAO
    29.     BANCO_0
    30.     MOVLW B'00000111'
    31.     MOVWF CMCON ; CONFIGURA RA3:RA0 COMO I/O
    32.     CLRF PORTA
    33.    
    34. MAIN
    35.     BSF LED ; ACENDE O LED
    36.     GOTO MAIN
    37.    
    38. END
    39.  

    - HERE IS THE OUTPUT:
    Code ( (Unknown Language)):
    1.  
    2. ----------------------------------------------------------------------
    3. Debug build of project `C:\Users\tarcisio\Documents\MPLab Projects\Projeto001\Projeto001.mcp' started.
    4. Language tool versions: MPASMWIN.exe v5.35, mplink.exe v4.35
    5. Preprocessor symbol `__DEBUG' is defined.
    6. Fri Jun 11 14:41:00 2010
    7. ----------------------------------------------------------------------
    8. Make: The target "C:\Users\tarcisio\Documents\MPLab Projects\Projeto001\principal.o" is out of date.
    9. Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "principal.asm" /l"principal.lst" /e"principal.err" /o"principal.o" /d__DEBUG=1
    10. Warning[205] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 5 : Found directive in column 1. (__CONFIG)
    11. Warning[205] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 15 : Found directive in column 1. (ORG)
    12. Warning[203] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 16 : Found opcode in column 1. (GOTO)
    13. Warning[205] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 19 : Found directive in column 1. (ORG)
    14. Warning[203] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 20 : Found opcode in column 1. (RETFIE)
    15. Message[302] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 25 : Register in operand not in bank 0.  Ensure that bank bits are correct.
    16. Warning[205] C:\USERS\TARCISIO\DOCUMENTS\MPLAB PROJECTS\PROJETO001\PRINCIPAL.ASM 37 : Found directive in column 1. (END)
    17. Make: The target "C:\Users\tarcisio\Documents\MPLab Projects\Projeto001\Projeto001.cof" is out of date.
    18. Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F628A "principal.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"Projeto001.cof" /M"Projeto001.map" /W
    19. MPLINK 4.35, Linker
    20. Copyright (c) 1998-2010 Microchip Technology Inc.
    21. Errors    : 0
    22.  
    23. MP2HEX 4.35, COFF to HEX File Converter
    24. Copyright (c) 1998-2010 Microchip Technology Inc.
    25. Errors    : 0
    26.  
    27. Loaded C:\Users\tarcisio\Documents\MPLab Projects\Projeto001\Projeto001.cof.
    28. ----------------------------------------------------------------------
    29. Debug build of project `C:\Users\tarcisio\Documents\MPLab Projects\Projeto001\Projeto001.mcp' succeeded.
    30. Language tool versions: MPASMWIN.exe v5.35, mplink.exe v4.35
    31. Preprocessor symbol `__DEBUG' is defined.
    32. Fri Jun 11 14:41:04 2010
    33. ----------------------------------------------------------------------
    34. BUILD SUCCEEDED
    35.  

    - Then I simulated and it goes as I spected: LED will turn on (PORTA VALUE = 0x01) [http://img808.imageshack.us/i/40124172.png/]
    - Ok, now I have the HEX data. If you want its here: [http://rapidshare.com/files/397919257/Projeto001.hex.html]
    - Back to the IC-PROG... I Open File... Projeto001.hex it is that:

    Code ( (Unknown Language)):
    1.  
    2. ; Generated by WinDis84, (c) Nigel Goodwin 1998.
    3.  
    4.             LIST      P=16F84, F=INHX8M
    5.             include "P16FXX.inc"
    6.             ORG     0x0000
    7.  
    8.             GOTO    Label_0001
    9.             RETLW   0x00
    10.             RETLW   0x00
    11.             ORG     0x0004
    12.             RETFIE
    13. Label_0001  BSF     STATUS    , RP0
    14.             MOVLW   0x00
    15.             MOVWF   TRISA
    16.             MOVLW   0x00
    17.             MOVWF   INTCON
    18.             BCF     STATUS    , RP0
    19.             MOVLW   0x07
    20.             MOVWF   0x1F
    21.             CLRF    PORTA
    22. Label_0002  BSF     PORTA     , 00
    23.             GOTO    Label_0002
    24.  
    25.             ORG     0x2000
    26.             DATA    0x0F
    27.             DATA    0x0F
    28.             DATA    0x0F
    29.             DATA    0x0F
    30.  
    31.             ORG     0x2007
    32.             DATA    0x18
    33.  
    34.             ORG     0x2100
    35.             [ LOTS OF DATA 0xFF ]
    36.  
    37.             END
    38.  
    - I choose PROGRAM ALL
    - It program, then it verify, and.... OK verified with sucess! [http://img706.imageshack.us/i/87934891.png/]
    - Then now, I choose READ ALL...
    - It read EXACTLY this:

    Code ( (Unknown Language)):
    1.  
    2. ; Generated by WinDis84, (c) Nigel Goodwin 1998.
    3.  
    4.             LIST      P=16F84, F=INHX8M
    5.             include "P16FXX.inc"
    6.             ORG     0x0000
    7.  
    8.             GOTO    Label_0001
    9.             RETLW   0x00
    10.             RETLW   0x00
    11.             ORG     0x0004
    12.             RETFIE
    13. Label_0001  BSF     STATUS    , RP0
    14.             MOVLW   0x00
    15.             MOVWF   TRISA
    16.             MOVLW   0x00
    17.             MOVWF   INTCON
    18.             BCF     STATUS    , RP0
    19.             MOVLW   0x07
    20.             MOVWF   0x1F
    21.             CLRF    PORTA
    22. Label_0002  BSF     PORTA     , 00
    23.             GOTO    Label_0002
    24.  
    25.             ORG     0x2000
    26.             DATA    0x0F
    27.             DATA    0x0F
    28.             DATA    0x0F
    29.             DATA    0x0F
    30.  
    31.             ORG     0x2007
    32.             DATA    0x00
    33.  
    34.  
    35.             END
    36.  
    Hmm... We really seem to have a problem there :O
    As You guys noted before, the code itself is ok, just now there's no more LOTS OF DATA 0XFF and
    ORG 0x2007
    DATA 0x18
    is now
    ORG 0x2007
    DATA 0x00

    That's bad, isn't, it ?

    I searched on google, and people say that may be a problem with the JDM Programmer hardware.
    http://www.asm51.eng.br/phpBB/viewt...ghlight=&sid=885baa9ef2ec2180d29b0ef4154b58dd
    "O programador JDM possui uma variante para o pic16f628. O pino 10 (RB4) é desconectado de onde estava e conectado ao nó dos pinos Vss, RB0, 1, 2, 3, RA1, RA3 e os componentes que estão ligados a este nó. "

    That sucks :(
     
  19. nolfolk

    Thread Starter New Member

    Jun 9, 2010
    10
    0
    IT WORKED !!!!

    Thanks everyone :D I did it :D
    Thanks, t06afre for your patience :D

    A guy in another forum said to change the programmer from IC-Prog to WINPIC800, and that's all!

    And I didn't even put a capacitor in the circuit, I did it like this:
    Pin5 = VSS -> - on my battery
    Pin14 = VDD -> + on my battery
    Pin17 = RA0 -> resistor // resistor -> LED // LED -> - on my battery

    Thanks everyone. I'm very happy now :D
    I know it sounds stupid, I just turned a LED on, but ... I don't know, I'm just very happy now :D Hahahaha

    Thanks, thanks :D
     
Loading...