1 package com.atmel.fpslic;
5 public class ChipImpl extends FtdiUart implements Chip {
18 super(0x6666, 0x3133);
22 public void doReset() {
45 //try { Thread.sleep(500); } catch (Exception e) { }
49 try { Thread.sleep(500); } catch (Exception e) { }
50 if (initErr()) throw new RuntimeException("INIT was still high after pulling RESET low");
51 //System.out.println("0 con() = " + con());
55 try { Thread.sleep(500); } catch (Exception e) { }
56 if (!initErr()) throw new RuntimeException("INIT was still low after releasing RESET");
57 //System.out.println("1 con() = " + con());
61 public void config(boolean bit) { config(bit?1:0, 1); }
62 public void config(int dat) { config(dat, 8); }
63 public void config(int dat, int numbits) {
64 for(int i=(numbits-1); i>=0; i--) {
65 boolean bit = (dat & (1<<i)) != 0;
72 // tricky: RESET has a weak pull-up, and is wired to a CBUS line. So,
73 // we can pull it down (assert reset) from uart-mode, or we can
74 // let it float upward from either mode.
75 public void reset(boolean on) {
76 uart(1<<1, on ? (1<<1) : 0);
84 public void avrrst(boolean on) { dbang(7, on); }
85 public void clk(boolean on) { dbang(6, on); }
86 public void data(boolean on) { dbang(5, on); }
88 public boolean initErr() { flush(); return (readPins() & (1<<4))!=0; }
90 public boolean con() {
94 return (readPins() & (1<<0)) != 0;
96 public boolean rcon() {
100 return (readPins() & (1<<0)) != 0;
102 public void con(boolean on) {