Inital test for the "lf em4x 410xsim / lf em4x 410xwatch" which I try to verify that the sim works.

Something about speed,  the clock detection is not so good.  should be 64,  usually 67..
This commit is contained in:
iceman1001
2014-10-27 19:46:21 +01:00
parent 1010aacca0
commit 2ae8a312e0
16 changed files with 379 additions and 39 deletions

View File

@@ -949,7 +949,6 @@ void UsbPacketReceived(uint8_t *packet, int len)
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
uint8_t *b = (uint8_t *)BigBuf;
memcpy(b+c->arg[0], c->d.asBytes, 48);
//Dbprintf("copied 48 bytes to %i",b+c->arg[0]);
cmd_send(CMD_ACK,0,0,0,0,0);
break;
}

View File

@@ -450,13 +450,17 @@ void WriteTItag(uint32_t idhi, uint32_t idlo, uint16_t crc)
void SimulateTagLowFrequency(int period, int gap, int ledcontrol)
{
int i;
uint8_t *tab = (uint8_t *)BigBuf;
uint8_t *buff = (uint8_t *)BigBuf;
FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 95); //125Khz
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT);
AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT | GPIO_SSC_CLK;
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
// Give it a bit of time for the resonant antenna to settle.
SpinDelay(150);
AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT | GPIO_SSC_CLK;
AT91C_BASE_PIOA->PIO_OER = GPIO_SSC_DOUT;
AT91C_BASE_PIOA->PIO_ODR = GPIO_SSC_CLK;
@@ -476,7 +480,7 @@ void SimulateTagLowFrequency(int period, int gap, int ledcontrol)
if (ledcontrol)
LED_D_ON();
if(tab[i])
if(buff[i])
OPEN_COIL();
else
SHORT_COIL();