Compare commits
10 commits
b53d1914cf
...
bf69d871f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf69d871f4 | ||
|
|
119f776fc3 | ||
|
|
09face2e57 | ||
|
|
85b304d7db | ||
|
|
77452de170 | ||
|
|
6d56b99f89 | ||
|
|
50ab323173 | ||
|
|
ec13f94d99 | ||
|
|
67981e803f | ||
|
|
20c6f1a801 |
6 changed files with 115 additions and 57 deletions
4
Makefile
4
Makefile
|
|
@ -59,8 +59,8 @@ lfuse_sologse=0xA0
|
||||||
|
|
||||||
lfuse_chaos=0xef
|
lfuse_chaos=0xef
|
||||||
chaos_CFLAGS = -I.
|
chaos_CFLAGS = -I.
|
||||||
chaos.o: ads8688.h ltc1655.h spi_slave.h tick.h hvosc.h
|
chaos.o: ads8688.h ltc1655.h spi_slave.h tick.h hvosc.h hvled.h
|
||||||
chaos.s: ads8688.h ltc1655.h spi_slave.h tick.h hvosc.h
|
chaos.s: ads8688.h ltc1655.h spi_slave.h tick.h hvosc.h hvled.h
|
||||||
|
|
||||||
%.lfuse:
|
%.lfuse:
|
||||||
$(AVRDUDE) -p $(pMCU-$(MCU)) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
|
$(AVRDUDE) -p $(pMCU-$(MCU)) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
#define ADC_SDI 4
|
#define ADC_SDI 4
|
||||||
#define ADC_SCK 5
|
#define ADC_SCK 5
|
||||||
#define ADC_CE 7
|
#define ADC_CE 7
|
||||||
#define ADC_SDO 2
|
#define ADC_SDO 1
|
||||||
#define ADC_PO PORTD
|
#define ADC_PO PORTD
|
||||||
#define ADC_PI PORTB
|
#define ADC_PI PORTD
|
||||||
#define PORTB_IO 0x05
|
#define ADC_PO_IO _SFR_IO_ADDR(ADC_PO)
|
||||||
#define PORTD_IO 0x0b
|
#define ADC_PI_IO _SFR_IO_ADDR(ADC_PI)
|
||||||
static inline void ads8688_init()
|
static inline void ads8688_init()
|
||||||
{
|
{
|
||||||
DDRD |= 0xb0;
|
DDRD |= 0xb0;
|
||||||
|
|
@ -26,7 +26,7 @@ static inline void ads8688_write(unsigned char c, unsigned char i)
|
||||||
"nop" "\n\t"
|
"nop" "\n\t"
|
||||||
"cbi %[p], %[ck]" "\n"
|
"cbi %[p], %[ck]" "\n"
|
||||||
:
|
:
|
||||||
:[p] "n" (PORTD_IO),
|
:[p] "n" (ADC_PO_IO),
|
||||||
[d] "n" (ADC_SDI),
|
[d] "n" (ADC_SDI),
|
||||||
[ck] "n" (ADC_SCK),
|
[ck] "n" (ADC_SCK),
|
||||||
[c] "r" (c),
|
[c] "r" (c),
|
||||||
|
|
@ -34,12 +34,6 @@ static inline void ads8688_write(unsigned char c, unsigned char i)
|
||||||
}
|
}
|
||||||
static inline void ads8688_read(unsigned char *r, unsigned char *rr, unsigned char i)
|
static inline void ads8688_read(unsigned char *r, unsigned char *rr, unsigned char i)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ADC_PO |= (1<<ADC_SCK);
|
|
||||||
if (ADC_PI & (1<<ADC_SDO)) *r |= 1<<i;
|
|
||||||
if (!(ADC_PI & (1<<ADC_SDO))) *r &=~(1<<i);
|
|
||||||
ADC_PO &=~ (1<<ADC_SCK);
|
|
||||||
#else
|
|
||||||
// qq is a dummy requested here to avoid load/store between bytes.
|
// qq is a dummy requested here to avoid load/store between bytes.
|
||||||
|
|
||||||
__asm__("sbi %[pk], %[ck]" "\n\t"
|
__asm__("sbi %[pk], %[ck]" "\n\t"
|
||||||
|
|
@ -55,14 +49,13 @@ static inline void ads8688_read(unsigned char *r, unsigned char *rr, unsigned ch
|
||||||
"nop" "\n"
|
"nop" "\n"
|
||||||
:[q] "+d" (*r), // ORI needs r16..r31
|
:[q] "+d" (*r), // ORI needs r16..r31
|
||||||
[qq] "+d" (*rr)
|
[qq] "+d" (*rr)
|
||||||
:[pk] "n" (PORTD_IO),
|
:[pk] "n" (ADC_PO_IO),
|
||||||
[pd] "n" (PORTB_IO),
|
[pd] "n" (ADC_PI_IO),
|
||||||
[d] "n" (ADC_SDO),
|
[d] "n" (ADC_SDO),
|
||||||
[ck] "n" (ADC_SCK),
|
[ck] "n" (ADC_SCK),
|
||||||
[i] "n" (1<<i),
|
[i] "n" (1<<i),
|
||||||
[ii] "n" (0xff&~(1<<i))
|
[ii] "n" (0xff&~(1<<i))
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ads8688_frame(const unsigned char *c, unsigned char *r)
|
static inline void ads8688_frame(const unsigned char *c, unsigned char *r)
|
||||||
|
|
@ -92,7 +85,7 @@ static inline void ads8688_frame(const unsigned char *c, unsigned char *r)
|
||||||
__asm__("nop" "\n\t"
|
__asm__("nop" "\n\t"
|
||||||
"cbi %[p], %[d]" "\n"
|
"cbi %[p], %[d]" "\n"
|
||||||
:
|
:
|
||||||
:[p] "n" (PORTD_IO),
|
:[p] "n" (ADC_PO_IO),
|
||||||
[d] "n" (ADC_SDI)
|
[d] "n" (ADC_SDI)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
// ATmega32M1
|
// ATmega32M1
|
||||||
|
|
||||||
|
#define upcase(c) (!((c)&0x20))
|
||||||
|
|
||||||
const char *revision =
|
const char *revision =
|
||||||
|
|
||||||
"$Id$";
|
"$Id$";
|
||||||
|
|
@ -18,6 +20,7 @@ void ads8688_cmd(const unsigned char *c, unsigned char *r);
|
||||||
void ltc1655_cmd(const unsigned char *c);
|
void ltc1655_cmd(const unsigned char *c);
|
||||||
void ads8688_config();
|
void ads8688_config();
|
||||||
|
|
||||||
|
#include "hvled.h"
|
||||||
#include "tick.h"
|
#include "tick.h"
|
||||||
#include "hvosc.h"
|
#include "hvosc.h"
|
||||||
|
|
||||||
|
|
@ -46,7 +49,7 @@ static inline unsigned int avradc_data()
|
||||||
{
|
{
|
||||||
unsigned int r = ADCL;
|
unsigned int r = ADCL;
|
||||||
r |= ADCH << 8;
|
r |= ADCH << 8;
|
||||||
r |= ADMUX << 13;
|
r |= ADMUX << 11;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -105,7 +108,8 @@ struct {
|
||||||
unsigned char portc_on;
|
unsigned char portc_on;
|
||||||
unsigned char portc_off;
|
unsigned char portc_off;
|
||||||
unsigned char hvosc_freq;
|
unsigned char hvosc_freq;
|
||||||
unsigned char padding[1];
|
unsigned char hvosc_dc;
|
||||||
|
unsigned char padding[2];
|
||||||
} conf = {
|
} conf = {
|
||||||
.wdt_timeout = 10, // 2 min
|
.wdt_timeout = 10, // 2 min
|
||||||
.wdt_tick_period = TICK_NS(100000L), // 100µs
|
.wdt_tick_period = TICK_NS(100000L), // 100µs
|
||||||
|
|
@ -113,7 +117,8 @@ struct {
|
||||||
.avradc = 0x7f, // off
|
.avradc = 0x7f, // off
|
||||||
.adcconf = 0x8500,// RST
|
.adcconf = 0x8500,// RST
|
||||||
.ddrc = 2, // OC1B HVOSC
|
.ddrc = 2, // OC1B HVOSC
|
||||||
.hvosc_freq = 88, // 125 kHz
|
.hvosc_freq = 51,
|
||||||
|
.hvosc_dc = 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -127,6 +132,7 @@ enum {
|
||||||
FLAG2_PORTC = 1,
|
FLAG2_PORTC = 1,
|
||||||
FLAG2_PC_HV = 2,
|
FLAG2_PC_HV = 2,
|
||||||
FLAG2_HVOSC = 4,
|
FLAG2_HVOSC = 4,
|
||||||
|
FLAG2_HVLED = 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
void conf_init()
|
void conf_init()
|
||||||
|
|
@ -134,19 +140,23 @@ void conf_init()
|
||||||
tick_init(conf.tick_period);
|
tick_init(conf.tick_period);
|
||||||
if (conf.flags & FLAG_WDT)
|
if (conf.flags & FLAG_WDT)
|
||||||
wdt_init(conf.wdt_mode);
|
wdt_init(conf.wdt_mode);
|
||||||
|
if (conf.flags2 & FLAG2_HVOSC) {
|
||||||
|
conf.ddrc |= 2;
|
||||||
|
hvosc_init(conf.hvosc_freq, conf.hvosc_dc);
|
||||||
|
}
|
||||||
|
if (conf.flags & FLAG_ADCCONF)
|
||||||
|
ads8688_config();
|
||||||
|
if (conf.flags & FLAG_DACADC)
|
||||||
|
conf.dac = dacadc_read();
|
||||||
if (conf.flags & FLAG_RAMP)
|
if (conf.flags & FLAG_RAMP)
|
||||||
dac_ramp(conf.dac_nominal);
|
dac_ramp(conf.dac_nominal);
|
||||||
if (conf.flags & FLAG_ADC)
|
if (conf.flags & FLAG_ADC)
|
||||||
avradc_enable(conf.avradc);
|
avradc_enable(conf.avradc);
|
||||||
if (conf.flags & FLAG_DAC)
|
if (conf.flags & FLAG_DAC)
|
||||||
avrdac_set(conf.avrdac);
|
avrdac_set(conf.avrdac);
|
||||||
if (conf.flags & FLAG_ADCCONF)
|
if (conf.flags2 & FLAG2_HVLED) {
|
||||||
ads8688_config();
|
conf.ddrc |= LED_MASK;
|
||||||
if (conf.flags & FLAG_DACADC)
|
led_init();
|
||||||
conf.dac = dacadc_read();
|
|
||||||
if (conf.flags2 & FLAG2_HVOSC) {
|
|
||||||
conf.ddrc |= 2;
|
|
||||||
hvosc_init(conf.hvosc_freq);
|
|
||||||
}
|
}
|
||||||
if (conf.flags2 & FLAG2_PORTC) {
|
if (conf.flags2 & FLAG2_PORTC) {
|
||||||
PORTC = conf.portc;
|
PORTC = conf.portc;
|
||||||
|
|
@ -154,6 +164,16 @@ void conf_init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void led_hv()
|
||||||
|
{
|
||||||
|
if (conf.flags2 & FLAG2_HVLED) {
|
||||||
|
if (conf.dac == conf.dac_off)
|
||||||
|
led_toggle(LED_GREEN);
|
||||||
|
else
|
||||||
|
led_toggle(LED_RED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned long adc_sum[8];
|
unsigned long adc_sum[8];
|
||||||
unsigned int adc_noise[8];
|
unsigned int adc_noise[8];
|
||||||
unsigned char adc_n[8];
|
unsigned char adc_n[8];
|
||||||
|
|
@ -181,6 +201,7 @@ int main()
|
||||||
spi_slave_Rx(cmd, 3);
|
spi_slave_Rx(cmd, 3);
|
||||||
resp[0] = cmd[0];
|
resp[0] = cmd[0];
|
||||||
sreg = disable_irq();
|
sreg = disable_irq();
|
||||||
|
led_hv();
|
||||||
if (conf.wdt_mode == WDT_MODE_LIVE)
|
if (conf.wdt_mode == WDT_MODE_LIVE)
|
||||||
wdt_kick();
|
wdt_kick();
|
||||||
switch (cmd[0]) {
|
switch (cmd[0]) {
|
||||||
|
|
@ -214,7 +235,7 @@ int main()
|
||||||
if (conf.flags2 & FLAG2_PC_HV)
|
if (conf.flags2 & FLAG2_PC_HV)
|
||||||
PORTC = conf.portc_on;
|
PORTC = conf.portc_on;
|
||||||
if (conf.flags2 & FLAG2_HVOSC)
|
if (conf.flags2 & FLAG2_HVOSC)
|
||||||
hvosc_init(conf.hvosc_freq);
|
hvosc_init(conf.hvosc_freq, conf.hvosc_dc);
|
||||||
int2frame(conf.dac, resp+1);
|
int2frame(conf.dac, resp+1);
|
||||||
if (conf.wdt_mode >= WDT_MODE_HV)
|
if (conf.wdt_mode >= WDT_MODE_HV)
|
||||||
wdt_kick();
|
wdt_kick();
|
||||||
|
|
@ -223,10 +244,14 @@ int main()
|
||||||
dac_ramp(conf.dac_nominal);
|
dac_ramp(conf.dac_nominal);
|
||||||
continue;
|
continue;
|
||||||
case 'Q':
|
case 'Q':
|
||||||
conf.hvosc_freq = frame2int(cmd+1);
|
|
||||||
case 'q':
|
case 'q':
|
||||||
int2frame(conf.hvosc_freq, resp+1);
|
resp[1] = conf.hvosc_freq;
|
||||||
hvosc_init(conf.hvosc_freq);
|
resp[2] = conf.hvosc_dc;
|
||||||
|
if (upcase(cmd[0])) {
|
||||||
|
conf.hvosc_freq = cmd[1];
|
||||||
|
conf.hvosc_dc = cmd[2];
|
||||||
|
}
|
||||||
|
hvosc_init(conf.hvosc_freq, conf.hvosc_dc);
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
int2frame(tick_freq(), resp+1);
|
int2frame(tick_freq(), resp+1);
|
||||||
|
|
@ -241,20 +266,17 @@ int main()
|
||||||
ads8688_cmd(cmd+1, resp+1);
|
ads8688_cmd(cmd+1, resp+1);
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
resp[1] = adc_status;
|
|
||||||
resp[2] = adc_error;
|
|
||||||
enable_irq(sreg);
|
|
||||||
spi_slave_Tx(resp, 3);
|
|
||||||
if (cmd[1])
|
|
||||||
adc_read(cmd[1], cmd[2]);
|
|
||||||
continue;
|
|
||||||
case 't':
|
case 't':
|
||||||
resp[1] = adc_status;
|
resp[1] = adc_status;
|
||||||
resp[2] = adc_error;
|
resp[2] = adc_error;
|
||||||
enable_irq(sreg);
|
enable_irq(sreg);
|
||||||
spi_slave_Tx(resp, 3);
|
spi_slave_Tx(resp, 3);
|
||||||
if (cmd[1])
|
if (cmd[1]) {
|
||||||
|
if (upcase(cmd[0]))
|
||||||
|
adc_read(cmd[1], cmd[2]);
|
||||||
|
else
|
||||||
adc_dac = dacadc_read();
|
adc_dac = dacadc_read();
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
case 'R':
|
case 'R':
|
||||||
c = cmd[1] & 7;
|
c = cmd[1] & 7;
|
||||||
|
|
@ -318,8 +340,12 @@ int main()
|
||||||
resp[2] = conf.padding[0];
|
resp[2] = conf.padding[0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cmd[2]==1)
|
if (cmd[2]==1) {
|
||||||
|
enable_irq(sreg);
|
||||||
|
spi_slave_Tx(resp, 3);
|
||||||
conf_init();
|
conf_init();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
c = cmd[1] & 0x7f;
|
c = cmd[1] & 0x7f;
|
||||||
|
|
@ -349,7 +375,9 @@ int main()
|
||||||
PORTC = conf.portc = cmd[2];
|
PORTC = conf.portc = cmd[2];
|
||||||
break;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
|
case 'o':
|
||||||
resp[2] = DDRC;
|
resp[2] = DDRC;
|
||||||
|
if (upcase(cmd[1]))
|
||||||
DDRC = conf.ddrc = cmd[2];
|
DDRC = conf.ddrc = cmd[2];
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
|
|
@ -374,9 +402,12 @@ int main()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Y':
|
case 'Y': // peek
|
||||||
|
case 'y': // poke
|
||||||
resp[1] = cmd[1];
|
resp[1] = cmd[1];
|
||||||
resp[2] = *(unsigned char *)(cmd[1]+0);
|
resp[2] = *(unsigned char *)(cmd[1]+0);
|
||||||
|
if (!upcase(cmd[0]))
|
||||||
|
*(unsigned char *)(cmd[1]+0) = cmd[2];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
enable_irq(sreg);
|
enable_irq(sreg);
|
||||||
|
|
@ -497,7 +528,7 @@ ISR(WDT_vect)
|
||||||
if (conf.flags2 & FLAG2_PC_HV)
|
if (conf.flags2 & FLAG2_PC_HV)
|
||||||
PORTC = conf.portc_off;
|
PORTC = conf.portc_off;
|
||||||
if (conf.flags2 & FLAG2_HVOSC)
|
if (conf.flags2 & FLAG2_HVOSC)
|
||||||
hvosc_init(0);
|
hvosc_init(0, 0);
|
||||||
}
|
}
|
||||||
tick_init(conf.tick_period);
|
tick_init(conf.tick_period);
|
||||||
if (conf.wdt_save_addr && !wdt_saved) {
|
if (conf.wdt_save_addr && !wdt_saved) {
|
||||||
|
|
|
||||||
33
chaos/hvled.h
Normal file
33
chaos/hvled.h
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#include "avr/io.h"
|
||||||
|
#define LED1 2
|
||||||
|
#define LED2 3
|
||||||
|
#define LED_PORT PORTC
|
||||||
|
#define LED_GREEN (1<<LED1)
|
||||||
|
#define LED_RED (1<<LED2)
|
||||||
|
#define LED_MASK (LED_GREEN | LED_RED)
|
||||||
|
|
||||||
|
static inline void led_init()
|
||||||
|
{
|
||||||
|
DDRC |= LED_MASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint8_t led_status()
|
||||||
|
{
|
||||||
|
return LED_PORT & LED_MASK;
|
||||||
|
}
|
||||||
|
static inline void led_off()
|
||||||
|
{
|
||||||
|
LED_PORT &=~ LED_MASK;
|
||||||
|
}
|
||||||
|
static inline void led_on(uint8_t color)
|
||||||
|
{
|
||||||
|
LED_PORT &= ~(LED_MASK & ~color);
|
||||||
|
LED_PORT |= color;
|
||||||
|
}
|
||||||
|
static inline void led_toggle(uint8_t color)
|
||||||
|
{
|
||||||
|
if (led_status() == color)
|
||||||
|
LED_PORT &=~ color;
|
||||||
|
else
|
||||||
|
led_on(color);
|
||||||
|
}
|
||||||
|
|
@ -1,19 +1,20 @@
|
||||||
#include "avr/io.h"
|
#include "avr/io.h"
|
||||||
|
|
||||||
static inline void hvosc_init(unsigned char freq)
|
static inline void hvosc_init(unsigned char freq, unsigned char dc)
|
||||||
{
|
{
|
||||||
if (!freq) {
|
if (!dc || freq <= dc) {
|
||||||
TCCR1A = 0;
|
TCCR1A = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PRR &=~ (1<<PRTIM1);
|
PRR &=~ (1<<PRTIM1);
|
||||||
__asm__("NOP");
|
DDRC |= (1<<PC1);
|
||||||
|
DDRD |= (1<<PD2);
|
||||||
TCCR1A = (2<<COM1A0) | (3<<COM1B0) | (2<<WGM10);
|
TCCR1A = (2<<COM1A0) | (3<<COM1B0) | (2<<WGM10);
|
||||||
TCCR1B = (1<<CS10) | (3<<WGM12);
|
TCCR1B = (1<<CS10) | (2<<WGM12);
|
||||||
ICR1H = 0;
|
ICR1H = 0;
|
||||||
ICR1L = freq;
|
ICR1L = freq;
|
||||||
OCR1AH = 0;
|
OCR1AH = 0;
|
||||||
OCR1AL = freq>>1;
|
OCR1AL = dc;
|
||||||
OCR1BH = 0;
|
OCR1BH = 0;
|
||||||
OCR1BL = freq>>1;
|
OCR1BL = freq-dc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
#define DAC_SDI 4
|
#define DAC_SDI 4
|
||||||
#define DAC_SCK 5
|
#define DAC_SCK 5
|
||||||
#define DAC_CE 6
|
#define DAC_CE 6
|
||||||
#define DAC_PO PORTD
|
#define DAC_PORT PORTD
|
||||||
#define PORTD_IO 0x0b
|
#define DAC_PORT_IO _SFR_IO_ADDR(DAC_PORT)
|
||||||
|
|
||||||
static inline void ltc1655_init()
|
static inline void ltc1655_init()
|
||||||
{
|
{
|
||||||
|
|
@ -24,7 +24,7 @@ static inline void ltc1655_bit(unsigned char c, unsigned char i)
|
||||||
"nop" "\n\t"
|
"nop" "\n\t"
|
||||||
"sbi %[p], %[k]" "\n"
|
"sbi %[p], %[k]" "\n"
|
||||||
::
|
::
|
||||||
[p] "n" (PORTD_IO),
|
[p] "n" (DAC_PORT_IO),
|
||||||
[d] "n" (DAC_SDI),
|
[d] "n" (DAC_SDI),
|
||||||
[k] "n" (DAC_SCK),
|
[k] "n" (DAC_SCK),
|
||||||
[c] "r" (c),
|
[c] "r" (c),
|
||||||
|
|
@ -33,8 +33,8 @@ static inline void ltc1655_bit(unsigned char c, unsigned char i)
|
||||||
|
|
||||||
static inline void ltc1655_frame(const unsigned char *c)
|
static inline void ltc1655_frame(const unsigned char *c)
|
||||||
{
|
{
|
||||||
DAC_PO &=~ (1<<DAC_SCK);
|
DAC_PORT &=~ (1<<DAC_SCK);
|
||||||
DAC_PO &=~ (1<<DAC_CE);
|
DAC_PORT &=~ (1<<DAC_CE);
|
||||||
ltc1655_bit(c[1],7);
|
ltc1655_bit(c[1],7);
|
||||||
ltc1655_bit(c[1],6);
|
ltc1655_bit(c[1],6);
|
||||||
ltc1655_bit(c[1],5);
|
ltc1655_bit(c[1],5);
|
||||||
|
|
@ -58,6 +58,6 @@ static inline void ltc1655_frame(const unsigned char *c)
|
||||||
"nop" "\n\t"
|
"nop" "\n\t"
|
||||||
"nop" "\n"
|
"nop" "\n"
|
||||||
);
|
);
|
||||||
DAC_PO &=~ (1<<DAC_SCK);
|
DAC_PORT &=~ (1<<DAC_SCK);
|
||||||
DAC_PO |= (1<<DAC_CE);
|
DAC_PORT |= (1<<DAC_CE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue