bloquer en programmation de carte puce
Répondre à la discussion
Affichage des résultats 1 à 19 sur 19

bloquer en programmation de carte puce



  1. #1
    invite583ef665

    Unhappy bloquer en programmation de carte puce


    ------

    bnj
    voila j realiser JDM programmer il me reste de programmer la carte gold disposé de 16f84(partie logicielle)
    bon j'ai trouvé un programme réalisé par M. BIGONNOF
    je veux savoir ce programme je vais le transformer en .hex et l'ecrire à l'aide de ICPROG dans le pic 16f84????
    ce programme permet de lier le pic à 24lc16???
    moi dans mon application je dois faire un programme qui transfere mon nom à la memoire externe (24lc16) et il doit afficher à l'utilisateur entrer le code que vous voullez programmer dans la carte ?????
    qui sait la reponse je le prie de m'expliquer ce probleme car je me suis bloque serieusement je ne sais plus quoi faire je pose dans le forum des questions et ils me donnent des programmes que je ne sais meme pas ou stocker est ce que dans la pic ou 24lc16 ????????
    ssssssvvvvvvvvppppppp , j'ai la soutenance jeudi et je ne sais pas quioi faire aidez moi
    merci

    -----

  2. #2
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    pour programmer la 24C16 qui se trouve dans la carte gold.
    Il faut d'abord programmer un boot loader.
    Dans ICPROG ça s'appelle Smarcard Wizard.
    A+, pat

  3. #3
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    slt merci pour tout
    boot loarder??????
    ou le charger?

  4. #4
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    je pense qu'il le fait tout seul.
    fait une recherche sur le net, je n'utilise pas ICPROG pour faire ça ...
    A+, pat

  5. A voir en vidéo sur Futura
  6. #5
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    Sinon il te faut une interface phoenix.
    Tu l'as ?

    C'est quoi comme programmateur que tu as ?
    A+, pat

  7. #6
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    http://www.darkwire.com.au/IC%20Card%20Programmer.html
    Il faut un smartCard reader , je pense que c'est pareil que phoenix.
    ICPROG demande de déconnecter le prog de pic et de mettre la carte sur le card reader après avoir programmer le boot loader.
    A+, pat

  8. #7
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    j programmateur JDM Programmer que j'ai pris sur http://www.cartesapuce.fr/programmateur_gold_silver.htm

  9. #8
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    a mon avis ça suffira pas ...
    A+, pat

  10. #9
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    j'ai trouvé sur le site de ICPROG que je dois avoir deux fichier un du type 16f84.hex est pour le pic et le fichier 24c16.hex est pour l'eeprom. c'est ce qu'il me faut n'est ce pas ?
    mais je n'ai aucun fichier sauf celui que vous m'avez donné precedemment mais je ne sais pas si c'est 24lc16 ou pour pic
    dsl et merci beaucoup

  11. #10
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    Citation Envoyé par bouchtarat Voir le message
    j'ai trouvé sur le site de ICPROG que je dois avoir deux fichier un du type 16f84.hex est pour le pic et le fichier 24c16.hex est pour l'eeprom. c'est ce qu'il me faut n'est ce pas ?
    mais je n'ai aucun fichier sauf celui que vous m'avez donné precedemment mais je ne sais pas si c'est 24lc16 ou pour pic
    dsl et merci beaucoup
    clecard.hex pour le pic et 24c16.hex pour l'eeprom

    Il faudra faire aussi un lecteur de carte avec clelock.hex
    A+, pat

  12. #11
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    slt
    comment mais j realiser programmateur il me faut maintenant que les fichiers à charger
    merci

  13. #12
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    Citation Envoyé par bouchtarat Voir le message
    slt
    comment mais j realiser programmateur il me faut maintenant que les fichiers à charger
    merci
    Il en faut 2 !
    Un programmateur de pic Microchip (JDM)
    Un programmateur de SmartCard (Phoenix)

    1) On programme un bootloader qui permet de communiquer avec l'extérieur et de charger le 24C16.
    2)On communique grâce à Phoenix le fichier 24C16.
    3) On charge le prog définitif du Pic16F84.


    Ou alors autre méthode sans phoenix.

    1)On découpe le fichier 24C16 en 3 morceaux car il peut faire 2ko. et le pic 1ko seulement.
    2)On charge un bootloader (pas le même) qui écrit 1/3 de la 24C16 à l'adresse indiquée.
    3)On fait cette opération 3 fois avec les 3 tiers.
    4)
    5)On charge le prog définitif
    A+, pat

  14. #13
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    Loader 240 octets extrait de mon Programmateur de pic Winpp
    http://pagesperso-orange.fr/pat.deau...inPP/index.htm

    NB)
    Le pic doit passer en mode Run pour exécuter.
    C'est à dire mettre 5V sur MCLR


    Code:
    ; (C) 2001 Patrick DEAUBONNE
    ;
    ;                TITLE           "LD240.asm"
    ;                LIST           P=16C84
    ; This is compiled with picasm  
    ; picasm should compile with most ansi-c compilers
    
                    opt list
                    device pic16c84
                    config CP=off,OSC=xt
    
    		1 EQU 1
    
    		IO_PIN  EQU     007H    ;SET INPUT / OUTPUT PIN
    		IO_MASK EQU     07FH
    
    		INDIR	EQU	00H	; Indirect pointer
    		RTCC	EQU	01H	; Real time clock / counter
    		PCL 	EQU	02H	; Program counter low byte
    		STATUS	EQU	03H	; Status register
    		CY  	EQU	0	; Carry/borrow bit
    		DC  	EQU	1	; Digit carry
    		Z   	EQU	2	; Zero flag
    		PD  	EQU	3	; Power down
    		T0  	EQU	4	; Time-out bit
    		RP0 	EQU	5	; Register page select bits
    		RP1 	EQU	6	; Not used in 16C84
    		RP2 	EQU	7	; Not used in 16C84
    		FSR 	EQU	04H	; Indirect pointer
    		PORTA	EQU	05H	; PORT A
    		PORTB	EQU	06H	; PORT B
    		EEDATA	EQU	08H	; Eeprom data
    		EEADR	EQU	09H	; Eeprom address
    		PCLATH	EQU	0AH	; Program counter high byte
    		INTCON	EQU	0BH	; Interrupt control
    		GIE 	EQU	07H	;  global interrupt enable bit
    
    ;  if picasm doesn't like 08?H for register addresses (TRISA/B EECON1/2)
    ;  change to 05H, 06H, 08H and 09H :
    		OPTION_REG EQU  081H
    		TRISA	EQU	085H	; Data direction port A
    		TRISB	EQU	086H	; Data direction port B
    		EECON1	EQU	088H	; Eeprom control
    		EECON2	EQU	089H	; Eeprom control
    		RD  	EQU	0	;  eeprom rd bit
    		WR  	EQU	1	;  eeprom wr bit
    		WREN	EQU	2	;  eeprom wr enable bit
    		WRERR	EQU	3	;  eeprom ....
    		EEIF	equ	4	;  eeprom ....
    		W   	EQU	0	; W reg. as destination
    		F   	EQU	1	; F file as destination
    
    		TMP1	equ	0CH	; reg 0ch tmp
    		BITCNT  equ	0DH	; bit#
    		ADDRL	equ	0EH	; eeprom address
    		ADDRH	equ	0FH	; eeprom address
    		RCVSTAT	equ	10H	; RCVSTAT bit 0:= last byte to tx
    					;         bit 1:= last byte to rx
    		MyByte	equ 11H
    		tmp		equ 12H
    		page	equ 13H
    
    		SDATA   EQU     4       ;SERIAL EEPROM DATA LINE
    		SCLK    EQU     5       ;SERIAL EEPROM CLOCK LINE
    		CLK		equ		6		; CLK pic
    		SDA		equ		7		; SDA pic
    
    
    		ORG	000H
    ;
    ; Set data=rb7 = high (1), clk=0
    ; after reset send clockpulses until RB7=data goes low ( = ack)
    ; Sending data to the PIC:
    ; send the specified number of clockpulses
    ;    the first probe of RB7 occurs after 40 clockpulses
    ;    each new bit is probed after 28 clocks (8 bit data + 1 continue/ack bit)
    ;    send some  clock pulses and wait for "ack" = RB7=data goes low.
    ;    to ensure proper setup times:
    ;    1) wait for "ack"
    ;    2) send 4-8 clocks (only for word 0 and word 1)
    ;    3) repeat for all 8 bits:
    ;           set RB7 to value of the i'th data bit
    ;           send 28 clocks
    ;    4) if this is the last byte sent in this block the 9'th bit is 1
    ;       else it is 0. Set RB7 to this value and send 28 clocks
    ;    5) send 40 clockpulses
    ;    6) goto 1)
    ;
    ; The bytes sent have following format :
    ; word 0:  controlbyte, selects read/write and includes the high 3 bits of
    ;          the address. :  1010aaaR0 , R=1 if read data, R=0 if write data
    ; word 1:  lower 8bit of the address (24c16 eeprom): aaaaaaaa0
    ; word 2:  first  byte of data dddddddd0 (at address A)
    ; word 3:  second byte of data dddddddd0 (at address A+1)
    ; .....
    ; word 2+N:  last byte of data dddddddd1 (at adress A+N)
    ;                                      ^ signals last byte
    ; Reading data from the PIC:
    ;    Almost like sending data, send word 0 = command= 1010aaaR0=1010aaa10
    ;    Send lower 8 bit of address in word 1
    ;    Received bytes are only 8 bit wide.
    ;    Bytes will be sent by thru02 as long as clocks applied
    ;    and until MCLR is applied.
    ;
    ;    1) wait for "ack"
    ;    2) send 4-8 clocks
    ;    3) repeat for all 8 bits:
    ;           set RB7 to value of the i'th data bit
    ;           send 28 clocks
    ;    4) if this is the last byte sent in this block the 9'th bit is 1
    ;       else it is 0. Set RB7 to this value and send 28 clocks
    ;    5) send 40 clockpulses
    ;    6) do 1)-5) for word 0 and word 1
    ;    7) send 96 clocks
    ;    8) repeat for all 8 bits (i=0..7):
    ;           read bit value on RB7 of the i'th data bit
    ;           send 28 clocks
    ;    9) send 16 clocks
    ;   10) wait for "ack".
    
    
    
    ;-----------------------------------------------------------------------------
    ;  Program Start	Send Atr and Read data from decoder
    ;-----------------------------------------------------------------------------
    START
    		clrf	PORTA
    		clrf	PORTB
    		bsf 	STATUS,RP0
    		movlw	0x10
    		movwf	TRISA
    INTXX   bcf 	INTCON,GIE	; disable all interrupts
    		movlw	0xcf
    		movwf	TRISB
    		movlw	0x7f
    		movwf	OPTION_REG
    		bcf 	OPTION_REG,7
    		bcf     STATUS,RP0
    		BCF	    PORTA,0
    
    SLOOP		; read until controlbyte 0xa*  is received
    
    		movlw	1
    		movwf	page
    		clrw
    		call	0xfe	; ADDRH
    		movwf	ADDRH
    		call	0xff	; ADDRL at 0xfc
    		movwf	ADDRL
    		clrf	MyByte
    
    WRNEXT		;                ;do {  /* only max 16 byte page write */
    		bcf 	STATUS,RP0
    		BsF 	PORTA,0	; set sync low
    		movf	ADDRL,w
    		call	WRITE_EE ; write to eeprom
    		bcf 	STATUS,RP0
    		BCF	    PORTA,0
    WRNEXTB                ;  do {
    
    
    		movf	page,w
    		movwf	PCLATH
    		xorlw	1
    		btfss	STATUS,Z
    		goto	page2
    		movf	MyByte,w
    		call	0x100
    		goto	write_this
    page2
    		movf	page,w
    		xorlw	2
    		btfss	STATUS,Z
    		goto	page3
    		movf	MyByte,w
    		call	0x200
    		goto	write_this
    
    page3
    		movf	MyByte,w
    		call	0x300
    
    write_this
    		call	WRITE_BYTE
    
    		incf	MyByte,f
    		movf	Mybyte,w
    		xorlw	240
    		btfsc	STATUS,Z ;  while ( MyByte >0 )
    		goto	nextpage
    
    		incf	ADDRL,F	      ; W= (addrh,addrl)++
    		btfsc	STATUS,Z
    		incf	ADDRH,F
    
    		movf	ADDRH,W
    		xorlw	8
    		btfsc	STATUS,Z
    		goto	fin
    
    		movf	ADDRL,W
    		andlw	0fH
    		btfsc	STATUS,Z ;  while ( addrl&0xf >0 )
    		goto	next
    		goto    WRNEXTB
    next
    
    		call	BSTOP	 ;  send BSTOP
    		call	WRITE_EE ; write to eeprom
    		call	BSTOP	 ;  send BSTOP
    		goto	WRNEXT
    
    nextpage
    		clrf	MyByte
    		incf	page,f
    		movf	page,w
    		xorlw	2
    		btfss	STATUS,Z
    		goto	NEXT
    ;		goto	fin
    
    fin
    		call	BSTOP	 ;  send BSTOP
    		bsf 	STATUS,RP0
    		movlw	0x4F
    		movwf	TRISB
    		bcf 	STATUS,RP0
    ;		BCF 	PORTB,CLK	; set clock low again
    forever
    		BCF 	PORTB,SDA	; set clock low again
    		goto	forever
    
    
    
    
    
    
    
    
    
    ;######################################################
    ;	EEPROM WRITE ROUTINE
    ;######################################################
    ;		USED REG : EEADR, EEDATA, W, AADRH
    ;		IN	 : EEADR = write adress.
    
    WRITE_EE	MOVWF	EEADR
    WRITE_EE_DIR	CALL	BSTART		;generate start bit
    		BCF	STATUS,CY	;WRITE SEQUENCE
    		CALL	CONTROL_BYTE	;CALC CONTROL BYTE AND TRANSMIT
    		MOVF	EEADR,W 	;GET WORD ADRESS
    		GOTO	TX		;WRITE @ ADRESS COUNTER
    
    WRITE_BYTE	CALL	TX		;WRITE BYTE (W) @ ADRESS COUNTER
    ;		btfsc	RCVSTAT,0	;if lastbyte then
    ;		GOTO	BSTOP		;  END READ SEQUENCE
    		RETURN
    ;
    ;**********************************************
    ;	GENERATE CONTROL BYTE
    ;**********************************************
    CONTROL_BYTE	RLF	ADDRH,W		; => CY=1
    		ANDLW	B'00001111'     ;MASK OUT UPPER NIBBLE
    		IORLW	B'10100000'     ;COMPLETE BYTE 1010AAAD
    					;A=ADRESS D=DIRECTION
    
    					;SEND CONTROL BYTE
    
    
    ;**********************************************
    ;	TRANSMIT DATA SUBROUTINE
    ;**********************************************
    
    TX		MOVWF	EEDATA		;STORE BYTE TO TX
    		MOVLW	B'11001111'     ; set data,clock as outputs
    		TRIS	PORTB
    
    		CALL    TX4		;TRANSMIT 8 TIMES
    		CALL    TX4
    		nop
    		nop
    		GOTO 	BITIN
    
    TX4		CALL    TXLP
    		CALL    TXLP
    		CALL    TXLP
    TXLP	 	RLF	EEDATA,F	; ROTATE BIT TO CARRY
                    GOTO    BITOUT_R        ; send the bit to serial EE
    
    
    
    ;*********************************************
    ;	START BIT SUBROUTINE
    ;*********************************************
    
    BSTART		BSF	PORTB,SDATA	; make sure data is high
    		MOVLW	B'11001111'
    		TRIS	PORTB		; set data and clock lines for output
    		BSF	PORTB,SCLK	; set clock high
    		NOP
    		BCF	PORTB,SDATA	; data line goes low during
    		NOP
    		GOTO	BC_END		; high clock for start bit
    
    
    
    ;**********************************************
    ;	STOP BIT SUBROUTINE
    ;**********************************************
    
    
    BSTOP		BCF	PORTB,SDATA	; make sure data line is low
    		MOVLW	B'11001111'
    		TRIS	PORTB		; set data/clock lines as outputs
    		NOP
    		BSF	PORTB,SCLK	; set clock high
    			NOP
    		BSF	PORTB,SDATA	; data goes high while clock high
    					; for stop bit
    B_END		NOP
    BC_END		BCF	PORTB,SCLK	; set clock low again
    		RETURN
    
    
    
    ;**********************************************
    ;	BITOUT ROUTINE , SEND BIT WHEN CARRY SET
    ;**********************************************
    
    BITOUT		MOVLW	B'11001111'     ; set data,clock as outputs
    		TRIS	PORTB
    BITOUT_R	BTFSS	STATUS,CY	; check for state of data bit to xmit
    		BCF	PORTB,SDATA	; set data line low
    		BTFSC	STATUS,CY
    		BSF	PORTB,SDATA	; high? set data line high
    
    CLKOUT		BSF	PORTB,SCLK	; set clock line high
    		GOTO	B_END
    
    
    ;**********************************************
    ;	BITIN ROUTINE
    ;**********************************************
    BITIN		MOVLW	 B'11011111'    ; make SDATA an input line/SCLK = OUT
    		TRIS	 PORTB
    		bcf	OPTION_REG,7	; make sure weak pull-up is on
    BITIN_R		BSF	 PORTB,SCLK	; set clock line high
    ;		NOP
    ;		BSF	 STATUS,CY	; assume input bit is high
    ;		BTFSS	 PORTB,SDATA	; read the data bit
    ;		BCF	 STATUS,CY	; input bit was low ,clear CARRY
    ;		GOTO	 BC_END
    
    
    		movlw	2
    		movwf	tmp
    wait2
    		decf	tmp,f
    
    WAIT_ACK
    
    		movlw	0
    		movwf	tmp1
    
    wait1
    		BsF	    PORTA,1
    		BSF	    PORTA,2
    		BTFSs	 PORTB,SDATA	; read the data bit
    		GOTO	 BC_END
    
    		BCF	    PORTA,1
    		BCF	    PORTA,2
    
    		decf	tmp1,f
    		movf	tmp1,w
    		xorlw	0
    		btfss	STATUS,Z ;  while ( tmp1 >0 )
    		goto	WAIT1
    
    		movf	tmp,w
    		xorlw	0
    		btfss	STATUS,Z ;  while ( tmp >0 )
    		goto	WAIT2
    
    ;		goto	WAIT_ACK
    ;		goto	start
    		goto 	bc_end
    
    
    
    	org 0xfb
    	retlw	1
    	retlw	0
    ;	addwf PCL,F
    ;	retlw	01
    
    
    
    		END
    A+, pat

  15. #14
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    merci beaaucoup
    je vais essayer de comprendre ce programme avant jeudi pour savoir ou ecrire mon nom pour le transferer
    merci

  16. #15
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    c quoi picasm ?

  17. #16
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    est ce que dans ce programme que je vais entrer le nom
    c'est le programme final à placer dans le pic?

  18. #17
    invite583ef665

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    je n'ai pas su ou changer
    svp
    comment l'utilisateur va entrer son nom et automatiquement ca sera charger dans le 24lc16 c tout
    svp
    merci

  19. #18
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    Citation Envoyé par bouchtarat Voir le message
    c quoi picasm ?
    c est mon assembleur .
    voir sur mon site freepicbasic
    A+, pat

  20. #19
    freepicbasic

    Re : bloquer en programmation de carte puce heeeeellllllpppppp

    Citation Envoyé par bouchtarat Voir le message
    je n'ai pas su ou changer
    svp
    comment l'utilisateur va entrer son nom et automatiquement ca sera charger dans le 24lc16 c tout
    svp
    merci
    si l'on veut modifier les nom il faudra créer un programme qui génère le fichier 24C16 , voir le programme C alea24C.c
    A+, pat

Discussions similaires

  1. programmation lecteur de carte à puce en c
    Par johpascal dans le forum Électronique
    Réponses: 0
    Dernier message: 10/06/2008, 15h19
  2. programmation lecteur de carte à puce en c
    Par johpascal dans le forum Logiciel - Software - Open Source
    Réponses: 0
    Dernier message: 10/06/2008, 15h16
  3. probleme en programmation de carte puce
    Par invite583ef665 dans le forum Électronique
    Réponses: 8
    Dernier message: 28/05/2008, 21h38
  4. programmation de carte puce
    Par invite583ef665 dans le forum Électronique
    Réponses: 0
    Dernier message: 09/05/2008, 22h39
  5. Programmation sur une carte à puce
    Par invite91980b0a dans le forum Électronique
    Réponses: 8
    Dernier message: 06/05/2005, 22h44
Découvrez nos comparatifs produits sur l'informatique et les technologies.