P8000-Acessing via '138+'245

This commit is contained in:
Oliver Lehmann 2012-06-10 21:03:23 +00:00
parent 801b1e746c
commit a777ce8444
6 changed files with 30 additions and 16 deletions

View File

@ -174,7 +174,7 @@ T 67100 33100 9 8 1 0 0 0 1
T 68500 33100 9 8 1 0 0 0 1
1
T 71000 33400 9 7 1 0 0 0 1
$Revision: 1.11 $ / $Date: 2012/06/10 08:51:17 $
$Revision: 1.12 $ / $Date: 2012/06/10 21:03:24 $
T 71000 33100 9 8 1 0 0 0 1
Oliver Lehmann <lehmann@ans-netz.de>
N 50600 59400 51200 59400 4
@ -1055,8 +1055,8 @@ N 35300 40600 32600 40600 4
N 35300 40300 32600 40300 4
N 33800 38900 33800 41200 4
N 33500 38900 33500 40900 4
N 33200 38900 33200 40900 4
N 32900 38900 32900 40900 4
N 33200 38900 33200 40600 4
N 32900 38900 32900 40300 4
N 41600 42500 40800 42500 4
N 40800 38800 40800 42500 4
N 40800 38800 37300 38800 4

View File

@ -26,7 +26,7 @@
*/
/*
* $Id: wdc_config.h,v 1.12 2012/06/09 19:47:31 olivleh1 Exp $
* $Id: wdc_config.h,v 1.13 2012/06/10 21:03:23 olivleh1 Exp $
*/
@ -81,6 +81,6 @@
#define MEASURE_SDCARD_TIME 1
#undef MEASURE_SDCARD_TIME
#define DEBUG 0
#define DEBUG 3
#endif /* CONFIG_H_ */

View File

@ -26,7 +26,7 @@
*/
/*
* $Id: wdc_if_p8000.c,v 1.6 2012/06/09 19:47:31 olivleh1 Exp $
* $Id: wdc_if_p8000.c,v 1.7 2012/06/10 21:03:23 olivleh1 Exp $
*/
#include "config.h"
@ -48,6 +48,7 @@ void wdc_init_ports()
configure_pin_wdardy();
configure_pin_tr();
configure_pin_reset();
PORTD |= ( ( 1 << PIND5 ) );
configure_port_data_read();
}
@ -77,9 +78,11 @@ uint8_t wdc_read_data_from_p8k ( uint8_t *buffer, uint16_t count, uint8_t wdc_st
while ( !isset_info_wdardy() );
do {
while ( isset_info_wdardy() );
port_info_set ( INFO_ASTB | wdc_status );
PORTD |= ( ( 1 << PIND5 ) );
nop();
nop();
buffer[datacnt] = ( uint8_t ) port_data_get();
port_info_set ( wdc_status );
PORTD &= ~ ( ( 1 << PIND5 ) );
while ( !isset_info_wdardy() );
datacnt++;
} while ( datacnt < count );
@ -100,17 +103,19 @@ void wdc_write_data_to_p8k ( uint8_t *buffer, uint16_t count, uint8_t wdc_status
while ( !isset_info_wdardy() );
do {
while ( isset_info_wdardy() );
port_info_set ( INFO_TR | INFO_ASTB | wdc_status );
PORTD |= ( ( 1 << PIND5 ) );
nop();
nop();
port_data_set ( buffer[datacnt] );
port_info_set ( INFO_TR | wdc_status );
while ( !isset_info_wdardy() );
PORTD &= ~ ( ( 1 << PIND5 ) );
while ( !isset_info_wdardy() );
datacnt++;
} while ( datacnt < count );
while ( isset_info_wdardy() );
port_info_set ( INFO_TR | INFO_ASTB | wdc_status );
PORTD |= ( ( 1 << PIND5 ) );
nop();
port_info_set ( INFO_TR | wdc_status );
PORTD &= ~ ( ( 1 << PIND5 ) );
configure_port_data_read();
while ( !isset_info_wdardy() );
port_info_set ( INFO_CLEAR );

View File

@ -26,13 +26,13 @@
*/
/*
* $Id: wdc_if_p8000.h,v 1.8 2012/06/09 19:47:31 olivleh1 Exp $
* $Id: wdc_if_p8000.h,v 1.9 2012/06/10 21:03:23 olivleh1 Exp $
*/
#ifndef WDC_IF_PIO_H_
#define WDC_IF_PIO_H_
#define DELAY_PIO_US 450
#define DELAY_PIO_US 550
#define configure_port_data_read() DDR_DATA = 0x00 /* programs the DATA-Port as Input-only for reading from the P8000*/
#define configure_port_data_write() DDR_DATA = 0xff /* programs the DATA-Port as Out-only for writing to the P8000*/

View File

@ -29,7 +29,7 @@
/*
* P8000 WDC Emulator
*
* $Id: wdc_main.c,v 1.24 2012/06/09 19:47:31 olivleh1 Exp $
* $Id: wdc_main.c,v 1.25 2012/06/10 21:03:23 olivleh1 Exp $
*
* TODO: - right now, BTT entries are not taken into account
*/
@ -81,10 +81,18 @@ main ( void )
uint8_t errorcode;
uint8_t i8;
#endif
DDRD = 0xff;
PORTD = 0x00;
atmega_setup();
uart_puts_p ( PSTR ( "P8000 WDC Emulator 0.90\n" ) );
/*
configure_port_data_read();
PORTD |= ((1<<PIND5));
port_info_set(INFO_STAT_GCMD);
while(1);
*/
#ifdef MEASURE_SDCARD_TIME
measure_performance();
#else
@ -110,6 +118,7 @@ main ( void )
}
while ( 1 ) {
wdc_wait_for_reset();