Page 8 of 11

Re: Problema con prototipo calcolatrice z80

PostPosted: 05 Nov 2016, 16:02
by alieno75
schema.rar
(81.18 KiB) Downloaded 425 times

Re: Problema con prototipo calcolatrice z80

PostPosted: 05 Nov 2016, 20:10
by alieno75
rigol.rar
(81.36 KiB) Downloaded 453 times

Re: Problema con prototipo calcolatrice z80

PostPosted: 06 Nov 2016, 08:36
by legacy
se sono immagini e non pdf o progetti
non ha senso includerli come allegato
compresso, il forum gestisce immagini

Re: Problema con prototipo calcolatrice z80

PostPosted: 06 Nov 2016, 10:45
by alieno75
Ecco il codice attuale:

Code: Select all
  PORT_B EQU 0x06                   ; shadow copy of GPIO
   


    ;************************************************************************
    org 0x0000           ; effective reset vector
   

    ;***** MAIN PROGRAM

    ;***** Initialisation
    start   
            movlw   b'00000000'       ; configure GP2 (only) as an output
            tris    PORT_B

            clrf    PORT_B           ; start with shadow GPIO zeroed

    ;***** Main loop
    INIZIO:
            bcf PORT_B,0
            bsf PORT_B,0
            goto INIZIO           ; repeat forever
   
   END

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 13:25
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 13:26
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 13:41
by legacy
alieno75 wrote:Immagine_RIGOL.rar


perche' continui a mettere le immagini dentro un rar?
e' fastidioso dover scaricare un allegato
sopratutto se usi sempre lo stesso *filename*
ogni volta si creano alias su alias nella cartella download
che tocca poi cancellare, e non ha senso alcuno quando
il forum sa benissimo gestire le immagini!

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 13:47
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 13:49
by legacy
alieno75 wrote:Per non mettere un' immagine che occupa tutto il post


puoi ridimensionare
oppure puoi usare postimage e simili ed includere l'immagine come link esterno
url = …. ]nome immagine[ ….

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 13:51
by legacy
1> /dev/null 2> /dev/null | echo "+1" :roll:

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 15:51
by legacy
+1

ti segue solo 4Fun perche' e' un Santo
anzi Santo Subito, la pazienza infinita

Re: Problema con prototipo calcolatrice z80

PostPosted: 07 Nov 2016, 18:44
by Just4Fun
dsc_8657.jpg
dsc_8657.jpg (84.36 KiB) Viewed 13648 times


Ovviamente quello che ho appoggiato al braccio è la 1° edizione rilegata extralusso del datasheet dell'Intel 4004... :lol:

Re: Problema con prototipo calcolatrice z80

PostPosted: 10 Nov 2016, 21:52
by Just4Fun
Nel seguito lo schema di riferimento x collegare il PIC16F877 con i segnali generati, il flow della prima parte e il prog in assembler da testare se ok (ho provato a compilarlo con MPLAB IDE 8.82 e non ha dato errori):

Code: Select all
  list           p=16F877     
  #include       <p16F877.inc>


;***** VARIABLE DEFINITIONS

        UDATA
d1      res 1                   ; delay loop counters
d2      res 1
d3      res 1 
d4      res 1 
     

;************************************************************************
RESET   CODE    0x0000          ; effective reset vector
       

;***** MAIN PROGRAM

;***** Initialisation
start   
       movlw   b'11111000'      ; configure RB0, RB1, RB2 as output, others as input
       tris    PORTB

      bsf    PORTB,0         ; RB0 = CLOCK = 1
      bcf    PORTB,1         ; RB1 = RESET = 0 (active LOW)
      bcf    PORTB,2           ; RB2 = LED = ON (active LOW)

;***** Main loop
do_reset
      ;  do a 0.4s RESET LOW and send 1-0-1 1us clock pulses
      movlw   0x36         ; initialize delay counters
      movwf   d1
      movlw   0xE0
      movwf   d2
      movlw   0x01
      movwf   d3
delay_0
      bcf    PORTB,0            ; CLOCK = 0   
      bsf    PORTB,0            ; CLOCK = 1
      decfsz   d1, f
      goto   $+2
      decfsz   d2, f
      goto   $+2
      decfsz   d3, f
      goto   delay_0
   
      ; all done, so turn off LED and RESET
      bsf    PORTB,2           ; LED OFF
      bsf    PORTB,1           ; RESET = 1
   
      ;loop forever
endless
      goto    endless
     
      END



Ti conviene aggiungere un Led sul segnale M1 dello Z80 (vedi schema), così saprai quando stai eseguendo una nuova istruzione...

Re: Problema con prototipo calcolatrice z80

PostPosted: 11 Nov 2016, 17:09
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 13 Nov 2016, 15:31
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 13 Nov 2016, 15:42
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 15 Nov 2016, 22:33
by Just4Fun
Ecco il prog completo che ho testato usando un PIC16F876 che avevo:

Code: Select all
      list           p=16F877     
      #include       <p16F877.inc>


;***** VARIABLE DEFINITIONS

        UDATA
d1      res 1                   ; delay loop counters
d2      res 1
d3      res 1 
d4      res 1 
     

;************************************************************************
RESET   CODE    0x0000          ; effective reset vector
       

;***** MAIN PROGRAM

;***** Initialisation
start   
       movlw   b'00000001'     ; configure RB0 (PUSH BUTTON active LOW) as input, others as output
       tris    PORTB
       
       banksel   OPTION_REG
       bcf      OPTION_REG,NOT_RBPU   ; enable pull-ups on PORTB inputs
       banksel   PORTA

      movlw   b'111110'       ; configure RA0 (LED) as output, others as input
      tris    PORTA     

      bsf       PORTB,RB1      ; RB1 = CLOCK = 1
      bcf       PORTB,RB2         ; RB2 = RESET = 0 (active LOW)
      bcf       PORTA,RA0       ; RA0 = LED = ON (active LOW)

;***** Main loop
do_reset
      ;  do a 0.5s RESET LOW and send 1-0-1 1us clock pulses
      movlw   0x36         ; initialize delay counters
      movwf   d1
      movlw   0xE0
      movwf   d2
      movlw   0x01
      movwf   d3
delay_0
      bcf    PORTB,RB1       ; CLOCK = 0 (make a clock 1us 1-0-1 pulse)
       bsf    PORTB,RB1       ; CLOCK = 1
      decfsz   d1, f
      goto   $+2
      decfsz   d2, f
      goto   $+2
      decfsz   d3, f
      goto   delay_0
   
      ; all done, so turn off LED and RESET
      bsf    PORTA,RA0         ; LED OFF
      bsf    PORTB,RB2         ; RESET = 1
   
      ; Make a clock single pulse (0-1-0) if the PUSH BUTTON is pressed
test_pb
        btfsc   PORTB,RB0      ; PUSH BUTTON (RB0) pressed (active LOW)?
        goto    test_pb         ; No (is HIGH), test it again
        bcf       PORTA,RA0      ; Yes (is LOW), turn LED ON
       
        bcf       PORTB,RB1       ; CLOCK = 0   (make a clock 1us 1-0-1 pulse)
        bsf       PORTB,RB1       ; CLOCK = 1   
         
        ; 0.1s delay, than LED OFF 
        movlw   0x1F         ; initialize delay counters (0.1s)
      movwf   d1
      movlw   0x4F
      movwf   d2
Delay_1
      decfsz   d1, f
      goto   $+2
      decfsz   d2, f
      goto   Delay_1
      bsf       PORTA,RA0       ; LED OFF
   
      ; wait 0.4s before test PUSH BUTTON again
      movlw   0x36         ; initialize delay counters (0.4s)
      movwf   d1
      movlw   0xE0
      movwf   d2
      movlw   0x01
      movwf   d3
Delay_3
      decfsz   d1, f
      goto   $+2
      decfsz   d2, f
      goto   $+2
      decfsz   d3, f
      goto   Delay_3
      goto   test_pb
     
      END


Premendo il pulsante dopo la fase di reset, viene generato un impulso di clock singolo, tenendo premuto il pulsante vengono generati impulsi di clock uno ogni 0.5s (finché si mantiene premuto).

Qui il "treno" di impulsi di clock (in giallo) ed il segnale di reset (in celeste) durante la fase iniziale di reset:
F1.jpeg
F1.jpeg (75.36 KiB) Viewed 13563 times


Dettaglio della fase finale di reset. Notare come il clock venga bloccato ad 1 prima di disattivere il segnale di reset:
F2.jpeg
F2.jpeg (74.9 KiB) Viewed 13563 times


Questo è il singolo impulso di clock generato premendo il pulsante:
F3.jpeg
F3.jpeg (76.41 KiB) Viewed 13563 times

Re: Problema con prototipo calcolatrice z80

PostPosted: 16 Nov 2016, 16:51
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 16 Nov 2016, 16:52
by alieno75
Cancellato

Re: Problema con prototipo calcolatrice z80

PostPosted: 17 Nov 2016, 10:11
by Just4Fun
Ora hai tutto quello che serve x fare troubleshooting....

Due suggerimenti:

1. quando visualizzi + tracce fai in modo di spostarle in alto o in basso evitando che si sovrappongano..

2. il tuo DSO ha una bellissima interfaccia LAN con la quale puoi "catturare" gli screenshot perfettamente senza fare fotografie + o - sfocate (e anche moolto di +....).... usala.... ;)