mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-04-11 13:30:51 +02:00
add frequency ramp up from S21 Pro
This commit is contained in:
parent
be1242ec61
commit
edd39e0071
@ -164,10 +164,10 @@ void BM1370_send_hash_frequency(float target_freq)
|
||||
}
|
||||
|
||||
if (fb_divider == 0) {
|
||||
puts("Finding dividers failed, using default value (200Mhz)");
|
||||
ESP_LOGE(TAG, "Finding dividers failed, using default value (200Mhz)");
|
||||
} else {
|
||||
newf = 25.0 * (float) (fb_divider) / (float) (ref_divider * post_divider1 * post_divider2);
|
||||
printf("final refdiv: %d, fbdiv: %d, postdiv1: %d, postdiv2: %d, min diff value: %f\n", ref_divider, fb_divider,
|
||||
ESP_LOGI(TAG, "final refdiv: %d, fbdiv: %d, postdiv1: %d, postdiv2: %d, min diff value: %f\n", ref_divider, fb_divider,
|
||||
post_divider1, post_divider2, min_difference);
|
||||
|
||||
freqbuf[3] = fb_divider;
|
||||
@ -186,9 +186,10 @@ void BM1370_send_hash_frequency(float target_freq)
|
||||
|
||||
static void do_frequency_ramp_up() {
|
||||
|
||||
//PLLO settings taken from a S21 dump.
|
||||
//PLLO settings taken from a S21 Pro dump.
|
||||
//todo: do this right.
|
||||
uint8_t freq_list[65][4] = {{0x40, 0xA2, 0x02, 0x55},
|
||||
uint8_t freq_list[89][4] = {
|
||||
{0x40, 0xA2, 0x02, 0x55},
|
||||
{0x40, 0xAF, 0x02, 0x64},
|
||||
{0x40, 0xA5, 0x02, 0x54},
|
||||
{0x40, 0xA8, 0x02, 0x63},
|
||||
@ -218,6 +219,7 @@ static void do_frequency_ramp_up() {
|
||||
{0x40, 0xB4, 0x02, 0x41},
|
||||
{0x40, 0xB9, 0x02, 0x41},
|
||||
{0x40, 0xBE, 0x02, 0x41},
|
||||
{0x50, 0xC3, 0x02, 0x41},
|
||||
{0x40, 0xA0, 0x02, 0x31},
|
||||
{0x40, 0xA4, 0x02, 0x31},
|
||||
{0x40, 0xA8, 0x02, 0x31},
|
||||
@ -227,6 +229,7 @@ static void do_frequency_ramp_up() {
|
||||
{0x40, 0xA1, 0x02, 0x60},
|
||||
{0x40, 0xBC, 0x02, 0x31},
|
||||
{0x40, 0xA8, 0x02, 0x60},
|
||||
{0x50, 0xC4, 0x02, 0x31},
|
||||
{0x40, 0xAF, 0x02, 0x60},
|
||||
{0x50, 0xCC, 0x02, 0x31},
|
||||
{0x40, 0xB6, 0x02, 0x60},
|
||||
@ -252,11 +255,33 @@ static void do_frequency_ramp_up() {
|
||||
{0x40, 0xB4, 0x02, 0x40},
|
||||
{0x50, 0xDB, 0x02, 0x50},
|
||||
{0x40, 0xB9, 0x02, 0x40},
|
||||
{0x50, 0xE0, 0x02, 0x50}};
|
||||
{0x50, 0xE1, 0x02, 0x50},
|
||||
{0x40, 0xBE, 0x02, 0x40},
|
||||
{0x50, 0xE7, 0x02, 0x50},
|
||||
{0x50, 0xC3, 0x02, 0x40},
|
||||
{0x50, 0xED, 0x02, 0x50},
|
||||
{0x40, 0xA0, 0x02, 0x30},
|
||||
{0x40, 0xA2, 0x02, 0x30},
|
||||
{0x40, 0xA4, 0x02, 0x30},
|
||||
{0x40, 0xA6, 0x02, 0x30},
|
||||
{0x40, 0xA8, 0x02, 0x30},
|
||||
{0x40, 0xAA, 0x02, 0x30},
|
||||
{0x40, 0xAC, 0x02, 0x30},
|
||||
{0x40, 0xAE, 0x02, 0x30},
|
||||
{0x40, 0xB0, 0x02, 0x30},
|
||||
{0x40, 0xB2, 0x02, 0x30},
|
||||
{0x40, 0xB4, 0x02, 0x30},
|
||||
{0x40, 0xB6, 0x02, 0x30},
|
||||
{0x40, 0xB8, 0x02, 0x30},
|
||||
{0x40, 0xBA, 0x02, 0x30},
|
||||
{0x40, 0xBC, 0x02, 0x30},
|
||||
{0x40, 0xBE, 0x02, 0x30},
|
||||
{0x50, 0xC0, 0x02, 0x30},
|
||||
{0x50, 0xC0, 0x02, 0x30}};
|
||||
|
||||
uint8_t freq_cmd[6] = {0x00, 0x08, 0x40, 0xB4, 0x02, 0x40};
|
||||
|
||||
for (int i = 0; i < 65; i++) {
|
||||
for (int i = 0; i < 89; i++) {
|
||||
freq_cmd[2] = freq_list[i][0];
|
||||
freq_cmd[3] = freq_list[i][1];
|
||||
freq_cmd[4] = freq_list[i][2];
|
||||
@ -433,9 +458,6 @@ int BM1370_set_default_baud(void)
|
||||
|
||||
int BM1370_set_max_baud(void)
|
||||
{
|
||||
|
||||
/// return 115749;
|
||||
|
||||
// divider of 0 for 3,125,000
|
||||
ESP_LOGI(TAG, "Setting max baud of 1000000 ");
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#define BM1370_INITIAL_DIFFICULTY 256
|
||||
|
||||
#define BM1370_SERIALTX_DEBUG false
|
||||
#define BM1370_SERIALTX_DEBUG true
|
||||
#define BM1370_SERIALRX_DEBUG false
|
||||
#define BM1370_DEBUG_WORK false //causes insane amount of debug output
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user