[<<][rtl][>>][..]
Wed Aug 15 14:15:43 EDT 2018

iceprog

Code says 6MHz, but board runs at 12Mhz, so this might not be sampled
correctly.

Does the 6MHz reflect the data rate or the actual clock signal
frequency?  E.g. if the actual clock frequency is 3MHz then we're
good.


BITMODE_MPSSE

void send_spi(uint8_t *data, int n)
{
	if (n < 1)
		return;

	send_byte(0x11);
	send_byte(n-1);
	send_byte((n-1) >> 8);

	int rc = ftdi_write_data(&ftdic, data, n);
	if (rc != n) {
		fprintf(stderr, "Write error (chunk, rc=%d, expected %d).\n", rc, n);
		error();
	}
}


http://www.ftdichip.com/Support/Documents/AppNotes/AN_135_MPSSE_Basics.pdf

Ok, I'm not going to find this by staring at code and nonexistant
documentation.


https://learn.adafruit.com/adafruit-ft232h-breakout/mpsse-setup

https://github.com/devttys0/libmpsse

Use this code as documentation:

https://github.com/devttys0/libmpsse.git

From this:


This command sets div x5, generating 12MHz from 60Mhz
	TCK_X5			= 0x8A,

Then putting system_clock=12Mhz in here, the divisor for freq=6MHz is 0.
/* Convert a frequency to a clock divisor */
uint16_t freq2div(uint32_t system_clock, uint32_t freq)
{
	return (((system_clock / freq) / 2) - 1);
}
     factor  reg=factpr-1
6MHZ 1       0
3MHz 2       1
2MHz 3       2
...

So I can just change that.  Big or little endian?
From the other examples it seems to be little endian.

 	send_byte(0x86);
-	send_byte(0x00);
+	send_byte(0x01);
 	send_byte(0x00);





[Reply][About]
[<<][rtl][>>][..]