AT90S2313 and AT2323 programmer for Linux

Features

wiring

Modified source

Only minor changes were necessary to implement programmer under linux. As this programmer is self powered it needs additional Vcc pins control!
/* begin of avr_serial_pp functions */

ASPP * aspp_new() {
  return (ASPP *) malloc(sizeof(ASPP));
}

ASPP * aspp_init(ASPP *aspp, unsigned short base) {
#ifdef IGOR_PROGRAMMER
  aspp->VCC1=rpp_init(rpp_new(), base, 2, 0); /* nStrobe */
  aspp->VCC2=rpp_init(rpp_new(), base, 2, 1); /* nLinefeed */
  aspp->VCC3=rpp_init(rpp_new(), base, 2, 2); /* Init */
  aspp->SCK=rpp_init(rpp_new(), base, 0, 0);  /* D0 */
  aspp->MISO=rpp_init(rpp_new(), base, 1, 3); /* Error */
  aspp->MOSI=rpp_init(rpp_new(), base, 0, 1); /* D1 */
  aspp->RESET=rpp_init(rpp_new(), base, 0, 2); /* D2 */
#else                   
  aspp->SCK=rpp_init(rpp_new(), base, 2, 0);  /* nStrobe */
  aspp->MISO=rpp_init(rpp_new(), base, 1, 7); /* nBusy */
  aspp->MOSI=rpp_init(rpp_new(), base, 0, 0); /* D0 */
  aspp->RESET=rpp_init(rpp_new(), base, 2, 2); /* Init */
  aspp->VCC1=NULL;
  aspp->VCC2=NULL;
  aspp->VCC3=NULL;
#endif
  return aspp;
}

void aspp_delete(ASPP *aspp) {
  rpp_delete(aspp->SCK);
  rpp_delete(aspp->MISO);
  rpp_delete(aspp->MOSI);
  rpp_delete(aspp->RESET);
  rpp_delete(aspp->VCC1);
  rpp_delete(aspp->VCC2);
  rpp_delete(aspp->VCC3);
  free(aspp);
}

#ifdef IGOR_PROGRAMMER
void aspp_SCK(ASPP *aspp, int data) {
  rpp_write(aspp->SCK, data);
}

int aspp_MISO(ASPP *aspp) {
  return rpp_read(aspp->MISO);
}

void aspp_MOSI(ASPP *aspp, int data) {
  rpp_write(aspp->MOSI, data);
}

void aspp_RESET(ASPP *aspp, int data) {
  rpp_write(aspp->RESET, data);
}

void aspp_VCC(ASPP *aspp, int data) {
  rpp_write(aspp->VCC1, !data);
  rpp_write(aspp->VCC2, !data);
  rpp_write(aspp->VCC3, data);
}

#else

void aspp_SCK(ASPP *aspp, int data) {
  rpp_write(aspp->SCK, !data);
}

int aspp_MISO(ASPP *aspp) {
  return ! rpp_read(aspp->MISO);
}

void aspp_MOSI(ASPP *aspp, int data) {
  rpp_write(aspp->MOSI, data);
}

void aspp_RESET(ASPP *aspp, int data) {
  rpp_write(aspp->RESET, data);
}

void aspp_VCC(ASPP *aspp, int data) {
}

#endif
/* end of avr_serial_pp functions */

Download

avrprog-0.2.2.tar.gz
Last modified: Tue Apr 6 10:05:26 CEST 2004