How greedy are A/D converters?

Go To Last Post
19 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My latest project includes a big fat 128x64 display so it's no surprise that it uses ~100mA on startup.

 

BUT after several seconds I enable A2D and start taking just one reading every second (for battery volts) and the consumption hikes up to 160mA. is this normal? Nothing is getting warm.

 

It's me again...

Last Edited: Thu. Apr 7, 2016 - 04:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think the technical word for "greedy" that you are looking for is "impedance" in fact.

 

(then again, what do I know, I'm only a bit mangler :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cheeky I would use "thirsty"...

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greedy, thirsty, ... something is wrong.

 

Post your schematic.   Photo of a pencil drawing is fine.

Post your code.

 

You normally have a 100nF capacitor on the AREF pin.  

You do not connect it to anywhere else unless you have a real external reference.

And if you do have a real external reference,   the software must be correct or you do serious damage.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at some of the AVR's characteristics graphs and tables.  Even at high speed, and AVR draws a "few" milliamps.  Determine where your 100+ comes from.  The display itself?  Back light?  It ain't the ADC.  +60mA is about in "hard short" territory.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here we go.

 

The display is on another board, driven via the SPI connector. (yes a PITA as I have to swap the connector every time I reprogram it...)

 

Much of the board is unpopulated - no FETS, only one Polulu, nothing hung off the connectors. R4 and R5 are now 100K and a 50K pot respectively.

 

Arefis bno longer connected to AVcc  -it is left floating and has a 100n cap to ground.

 

 

/*
 * Goto_Scope_Drive.asm
 *
 *  Created: 25/03/2016 18:54:14
 *   Author: Neil
 */ 

 .include		"macros.inc"

;Crytsal frequency 16.384 MHz

;*****These are my pin and register names***************************

.def	status		=r0     ; to preserve status register

.def	timer		=r5    ; constant for timer loading
.def	count	 	=r6    ; Count down the delay
;.def	temp2		=r7
.def	temp4		=r8
.def	temp5		=r9		;
.def	delay		=r8		;used by timers
;.def				=r11	;
;.def				=r12	;
;.def				=r13	;
.def	temp6		=r14	;for USB

.def	command		=r16	;display command
.def	data		=r17	;display data
.def	temp1		=r18	; scratch register
.def	delay		=r19	;
.def	temp		=r20	; scratch register
.def	temp2		=r21	;scratch
.def	decimal		=r22	; used for maths
.def	temp3		=r23	;scratch
;.def	menu1		=r24	;tracking rate, hemisphere
.def	flags		=r25	;bit 7 is 1ms flag

;Bits of FLAGS

.equ	tick				=0	;set every millisecond
.equ	pressed				=1	;set when button pressed
.equ	lead_zero			=2	;leading zero flag
.equ	tenth_second_tick	=3	;set every 0.1 second
;.equ	fdata				=4	;frequency data available
.equ	second_tick			=5	;set every second
.equ	stop	=6			;stopped flag
.equ	direction = 7		;1=clockwise

;Port D pins
.equ USBRXD	=0	;USB Recieve Data
.equ USBTXD	=1	;USB Transmit Data
.equ SERRX	=2	;RS232 RX
.equ SERTX	=3	;RS232 TX
.equ RASTP	=4	;RA Stepper Step
.equ DECSTP	=5	;DEC Stepper Step
.equ FOCSTP	=6	;FOCUS Stepper Step
.equ SPARE	=7	;Spare pin, unconnected

;Port B pins
.equ EX0	=0	;Expansion 0
.equ EX1	=1	;Expansion 1
.equ EX2	=2	;Expansion 2
.equ EX3	=3	;Expansion 3
.equ SS		=4	;SS can also be used as a general puropse output ONLY
.equ MOSI	=5	;MOSI
.equ MISO	=6	;MISO
.equ SCK	=7	;SCK

;Port A pins
.equ KEYLF	=0	;Handset Left
.equ KEYRT	=1	;Handset Right
.equ KEYUP	=2	;Handset Up
.equ KEYDN	=3	;Handset Down
.equ KEYMN	=4	;Handset Menu

.equ KB1	=5	;Keyboard 1
.equ KB2	=6	;Keyboard 2
.equ BATTERY	=7	;Power supply voltage divider

;Port C pins
.equ LED1	=0	;LED with PWM
.equ HEAT1	=1	;Heater 1 PWM
.equ HEAT2	=2	;Heater 2 PWM
.equ STPRST	=3	;Stepper reset
.equ STPMST	=4	;microStepping
.equ FOCDIR	=5	;FOCUS Stepper 1 direction
.equ DECDIR	=6	;DEC Stepper 2 direction
.equ RADIR	=7	;RA Stepper 1 ddirection

;******************************************************************
;Macros

.MACRO wait
		ldi	delay, @0
		rcall inescapable_wait
.ENDMACRO

.macro TAB
;Move text cursor. Range is X 0-15, y 0-7

ldi	temp,0x1F
rcall	OSWRCH
ldi	temp,@0
rcall	OSWRCH
ldi	temp,@1
rcall	OSWRCH

.endmacro

.macro TEXT_COLOUR ;0 white, 1 black

ldi	temp,0x11
rcall	OSWRCH
ldi temp,@0
rcall	OSWRCH

.endmacro

.macro TEXT_SIZE		;4, 8, 16

ldi		data,@0
rcall	TEXTSIZE

.endmacro

;************PROGRAMME STARTS HERE

.cseg
.org 0

;************ IRQ Vectors ******************************
jmp	RESET			;External Pin, Power-on Reset, Brown-out Reset, Watchdog Reset, and JTAG AVR Reset
jmp	INT0			;External Interrupt Request 0
jmp	INT1			;External Interrupt Request 1
jmp	INT2			;External Interrupt Request 2
jmp	PCINT0			;Pin Change Interrupt Request 0
jmp	PCINT1			;Pin Change Interrupt Request 1
jmp	PCINT2			;Pin Change Interrupt Request 2
jmp	PCINT3			;Pin Change Interrupt Request 3
jmp	WDT				;Watchdog Time-out Interrupt
jmp	TIMER2_COMPA	;Timer/Counter2 Compare Match A
jmp	TIMER2_COMPB	;Timer/Counter2 Compare Match B
jmp	TIMER2_OVF		;Timer/Counter2 Overflow
jmp	TIMER1_CAPT		;Timer/Counter1 Capture Event
jmp	TIMER1_COMPA	;Timer/Counter1 Compare Match A
jmp	TIMER1_COMPB	;Timer/Counter1 Compare Match B
jmp	TIMER1_OVF		;Timer/Counter1 Overflow
jmp	TIMER0_COMPA	;Timer/Counter0 Compare Match A
jmp	TIMER0_COMPB	;Timer/Counter0 Compare match B
jmp	TIMER0_OVF		;Timer/Counter0 Overflow
jmp	SPI_STC			;SPI Serial Transfer Complete
jmp	USART0_RX		;USART0 Rx Complete
jmp	USART0_UDRE		;USART0 Data Register Empty
jmp	USART0_TX		;USART0 Tx Complete
jmp	ANALOG_COMP		;Analog Comparator
jmp	ADC_COMP		;ADC Conversion Complete
jmp	EE_READY		;EEPROM Ready
jmp	TWI				;2-wire Serial Interface
jmp	SPM_READY		;Store Program Memory Ready
jmp	USART1_RX		;USART1 Rx Complete
jmp	USART1_UDRE		;USART1 Data Register Empty
jmp	USART1_TX		;USART1 Tx Complete
;******************************************************

RESET:
	cli
	ldi temp,LOW(RAMEND)
	out SPL,temp
	ldi temp,HIGH(RAMEND)
	out SPH,temp

;*********Set Ports

	ldi	temp,1<<KB1|0<<KB2|0<<KEYLF|0<<KEYRT|0<<KEYUP|0<<KEYDN|0<<KEYMN|0<<BATTERY
	out	DDRA,temp		;Port A
	ldi	temp,1<<KB1
	out	PORTA,temp		;Pullup keyboard input

	ldi	temp,1<<MOSI|0<<MISO|1<<SCK|1<<SS|1<<EX0|1<<EX1|1<<EX2|1<<EX3
	out	DDRB,temp		;Port B
	clr	temp
	out	PORTB,temp		; a no pullups for now

	ldi	temp,1<<LED1|1<<HEAT1|1<<HEAT2|1<<STPRST|1<<STPMST|1<<FOCDIR|1<<DECDIR|1<<RADIR
	out	DDRC,temp		;Port C
	clr	temp
	out	PORTC,temp		;all low

	ldi	temp,1<<USBTXD|1<<SERTX|1<<RASTP|1<<DECSTP|1<<FOCSTP|1<<SPARE
	out	DDRD,temp		;Port C
	ldi	temp,1<<USBRXD|1<<SERRX
	out	PORTD,temp		;Pull up inputs

;*********Initialise timer 0

	ldi   temp,1<<cs02		;timer prescaler /256
	out   TCCR0B,temp		; 64KHz @ 16.384MHz clock
	ldi	temp,256-64			;gives 1KHz = 1ms tick
	mov	timer,temp

;	ldi	brightness,0xF0	; set brightness
;	out	OCR0A,brightness

;*********Initialise timer 1

	ldi	temp,0<<WGM11|0<<WGM10		;Phase correct PWM (up and down) interrupt at bottom, count in ICR1
	sts	TCCR1A,temp
	ldi	temp,1<<WGM13|0<<WGM12|0<<CS12|1<<CS11|0<<CS10	;Timer prescaler/8
	sts	TCCR1B,temp
	ldi temp, HIGH(59077)
	sts ICR1H,temp
	ldi	temp,LOW(59077)
	sts	ICR1L,temp

;*********Enable Timer interrrupts

    ldi   temp,1<<OCIE0A|1<<TOIE0	;enable timer 0 overflow & output compare A interrupts
    sts   TIMSK0,temp
	ldi   temp,1<<TOIE1				;Enable Timer 0 overflow interrupt
    sts   TIMSK1,temp	   

; Enable SPI, Master, set clock rate fck/66

	ldi temp,1<<SPE|1<<MSTR|1<<SPR0|1<<SPR1
	out SPCR,temp
	ldi temp,0<<SPI2X
	out SPSR,temp	

	;Initialise ADC AVCC internal 2.56 bandgap with cap on AREF left adjust single ended input on pin 7
	ldi	temp,(1<<REFS1)|(1<<REFS0)|(0<<ADLAR)|(0<<MUX4)|(0<<MUX3)|(1<<MUX2)|1<<MUX1|1<<MUX0
	sts	ADMUX,temp

;enable adc & Interrupts, prescale 16MHz/128=128KHz
	ldi	temp,(1<<ADEN)|(1<<ADIE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS1)
	sts	ADCSRA,temp

	clr	XL
	ldi	XH,0x01

;Disable digital input on pin7
	ldi	temp,1<<battery
	sts	DIDR0,temp

	clr   flags						;clear flag register

        sei             ;enable global interrupts

;Initialise 

;Initialise any RAM variables
;set time

wait 250
wait 250

rcall	HIDE_CURSOR

rcall OUTPUT_PS_STRING
.db	"GOTO Driver",0x00

rcall	GET_REALTIME

wait 250
wait 250

;Output splash bitmap

rcall	DRAW_BITMAP

TEXT_COLOUR 0	;White

TAB	7,7
rcall OUTPUT_PS_STRING
.db	"Phragsoft",0x00

TEXT_SIZE 4

TAB	20,1
rcall OUTPUT_PS_STRING
.db	" Telescope",0x00

TAB	20,2
rcall OUTPUT_PS_STRING
.db	"Controller",0x00

rcall	RESET_STEPPER

;rcall	SET_SLOW

;rcall	SET_CLOCKWISE

;ldi rate,1	;sidereal

;rcall SET_SIDEREAL

;ldi		menu1,0	;tracking rate
;ldi		menu,4	;slow adjust

;Display initial settings

rcall	FRAME_TRACKING_DISPLAY

MAIN:

;normal STPMST

	;Here we probably just want a routine to detect menu presses and move between screens
	;Maybe add some housekeeping

	;Test code

	wait 10

	sbrs	flags,tenth_second_tick
	rjmp	SKIP22
	cbr		flags,1<<tenth_second_tick
	;In this section place everything that needs to be done at a frequency of 1 second

	;Update time

	sbrs	flags,second_tick
	rjmp	SKIP22
	cbr		flags,1<<second_tick

	;In this section place everything that needs to be done at a frequency of 1 second

	rcall	UPDATE_TRACKING_DISPLAY
	rcall	UPDATE_UTC

	;start	ADC
	setb	ADCSRA,ADSC,temp

SKIP22:

	rjmp  MAIN

MENU_LOOP_IN:

	;Initialise Menu

MENU_LOOP:

	;Go round menu options and sub menus until a choice is made

	rjmp  MENU_LOOP

;***********************************************

;***********************************************

;DISPLAY CONTROL COMMANDS*************************************************************

;**************************

RS232_OUT:
	lds		temp6,UCSR0A
	sbrs	temp6,UDRE0
	rjmp	RS232_OUT
	sts		UDR0,temp
	ret

GET_RS232:
	lds		temp6,UCSR0A
	sbrs	temp6,RXC0
	rjmp	GET_RS232
	lds		temp,UDR0
	ret

USART0_RXC:  ; USART0 RX Complete Handler

	in	status,SREG         ;preserve status register

	push	temp

	lds	 	temp,UDR0
	cpi	temp,'F'				; Frequency report?
	brne	RS232_DONE

	rcall	GET_RS232		; read bits 32..24 (always zero)

RS232_DONE:
	pop	temp
		out   SREG,status  ;restore status register
	reti

;*************Routine to set '1ms' flag and reset counter

TIMER0_OVF:
        in		status,SREG         ;preserve status register
		out		TCNT0,timer

		push	temp

		lds		temp,millisecond_count
		inc		temp
		sts		millisecond_count,temp
		cpi		temp,100
		brlo	SKIP21
		clr		temp
		sts		millisecond_count,temp
		sbr		flags,1<<tenth_second_tick

		lds		temp,tenths_count
		inc		temp
		sts		tenths_count,temp
		cpi		temp,10
		brlo	SKIP21
		clr		temp
		sts		tenths_count,temp
		sbr		flags,1<<second_tick

	SKIP21:
		pop		temp

		sbr	flags,1<<tick
TIMEOUT:
		out   SREG,status  ;restore status register
		reti

TIMER1_OVF:  ; Timer1 Overflow Handler

				;Steps the RA Stepper at the prevailing rate UNLESS the stop flag is set

		in	status,SREG         ;preserve status register

		sbrc	flags,stop
		rjmp	is_stopped

		sbi PORTD,RASTP			 

		rcall fourteen_NOPS

		cbi PORTD,RASTP

		rcall fourteen_NOPS

IS_STOPPED:
		out   SREG,status  ;restore status register
		reti

;*************************Quadrature Decoder Stuff

XINT0:  ; External Interrupt0 Handler

		reti

XINT1:  ; External Interrupt1 Handler

		reti

TIMER0_COMPA:  ; Timer0 Compare A Handler

		reti	

;DEFAULT Interrupts

	WDT:				;Watchdog Time-out Interrupt
	USART0_RX:		;USART0 Rx Complete
	USART0_UDRE:		;USART0 Data Register Empty
	USART0_TX:		;USART0 Tx Complete
	TWI:				;2-wire Serial Interface
	USART1_RX:		;USART1 Rx Complete
	USART1_UDRE:		;USART1 Data Register Empty
	USART1_TX:		;USART1 Tx Complete
	 PCINT:  ; Pin Change Interrupt
	TIMER1_CAPT:  ; Timer1 Capture Handler
	 TIMER2_COMPA:  ; Timer2 CompareA Handler
	 TIMER1_COMPA:  ; Timer1 CompareA Handler
	 USART0_DRE:  ; USART0,UDR0 Empty Handler
	 USART0_TXC:  ; USART0 TX Complete Handler
	 ANALOG_COMP:	;Analog Comparator
	 TIMER2_COMPB:  ; Timer2 Compare B Handler
	 TIMER1_COMPB:  ; Timer1 Compare B Handler
	 TIMER0_COMPB:  ; Timer0 Compare B Handler
	 TIMER2_OVF:	;Timer2 Overflow
	 USI_START:  ; Usi Start Handler
	 USI_OVERFLOW:  ; USI Overflow Handler
	 EE_READY:  ; EEPROM Ready Handler
	 WDT_OVERFLOW:  ; Watchdog Overflow Handler
	 SPM_READY:		;Store Program Memory Ready
	 SPI_STC:			;SPI Serial Transfer Complete
	 reti

MOVE_FAST:
SKIP5:

	lsl	temp1		;two bytes per table entry

	add	ZL,temp1
	adc	ZH,temp

	lpm temp, Z+ ; Load constant from program
	sts ICR1H,temp

	lpm temp, Z
	sts	ICR1L,temp

SKIP3:
	sbic	PINB,KEYRT		;wait until switch released
	rjmp	SKIP3
	sbic	PINB,KEYDN
	rjmp	SKIP3

	sbi		PORTD,STPMST		;restore 1/16 microStepping
RESTORE_DIRECTION:
	sbrc	flags, direction
	rjmp	JUST_CLOCKWISE
	rjmp	JUST_ANTICLOCKWISE

;Set speeds for adjusting scope rate

	SET_SOLAR:
	cbr	flags,1<<stop
	ldi temp, HIGH(59077)
	sts ICR1H,temp
	ldi	temp,LOW(59077)
	sts	ICR1L,temp

	ret

	SET_SIDEREAL:
	cbr	flags,1<<stop
	ldi temp, HIGH(58916)
	sts ICR1H,temp
	ldi	temp,LOW(58916)
	sts	ICR1L,temp

	ret

	SET_LUNAR:
	cbr	flags,1<<stop
	ldi temp, HIGH(61128)
	sts ICR1H,temp
	ldi	temp,LOW(61128)
	sts	ICR1L,temp

	ret

	SET_CLOCKWISE:					;set flag and direction
	sbr	flags,1<<direction
	JUST_CLOCKWISE:					;set direction without changing flag
	cbi	PORTC,RADIR
	ret

	SET_ANTICLOCKWISE:
	cbr	flags,1<<direction
	JUST_ANTICLOCKWISE:
	sbi	PORTC,RADIR
	ret

	RESET_STEPPER:

	cbi PORTC,STPRST

	rcall fourteen_NOPS ;16 less two for the sbi

	sbi PORTC,STPRST

	rcall fourteen_NOPS
	ret

	SET_FAST:

	cbi PORTD,STPMST

	rcall fourteen_NOPS

	ret

	SET_SLOW:

	sbi PORTD,STPMST

	rcall fourteen_NOPS

	ret

	;*************************************************************
	;*  THE MAGIC LINE - NEW OR APPROVED CODE BELOW THIS LINE *
	;*************************************************************

RANGE_CHECK_DEC_COUNT:

push	temp
push	temp1
push	temp2
push	temp3
push	temp4
push	temp5

ldi		temp,0x07							;0x1FC07 = 130055 MOD DEC value by this amount (quarter Turn).
mov		temp3,temp
ldi		temp,0xFC
mov		temp4,temp
ldi		temp,0x01
mov		temp5,temp

lds		temp,DEC_COUNT
lds		temp1,DEC_COUNT+1
lds		temp2,DEC_COUNT+2

tst		temp2
brpl	DEC_POSITIVE

;IF DEC IS NEGATIVE take two's complement

rcall	TWOS_COMPLEMENT_DEC			;make positive to check

sub		temp,temp3
sbc		temp1,temp4
sbc		temp2,temp5

tst		temp2
brmi	DEC_OUT					;the stored value was less thamn DEC_MAX, so don't change it.

rcall	TWOS_COMPLEMENT_DEC			

rjmp	SAVE_RANGE_CHECKED_DEC	;the stored value was greater than DEC_MAX so save the reduced version.

DEC_POSITIVE:
sub		temp,temp3
sbc		temp1,temp4
sbc		temp2,temp5

tst		temp2
brmi	DEC_OUT					;the stored value was less thamn DEC_MAX, so don't change it.
rjmp	SAVE_RANGE_CHECKED_DEC	;the stored value was greater than DEC_MAX so save the reduced version.

SAVE_RANGE_CHECKED_DEC:

sts		DEC_COUNT,temp
sts		DEC_COUNT+1,temp1
sts		DEC_COUNT+2,temp2

DEC_OUT:

pop		temp5
pop		temp4
pop		temp3
pop		temp2
pop		temp1
pop		temp

ret

TWOS_COMPLEMENT_DEC:

ser		decimal
eor		temp,decimal
eor		temp1,decimal
eor		temp2,decimal
clr		decimal
inc		temp
adc		temp1,decimal
adc		temp2,decimal

ret

RANGE_CHECK_RA_COUNT:

push	temp
push	temp1
push	temp2
push	temp3
push	temp4
push	temp5

ldi		temp,0x00							;0x16DA00 = 1497600 MOD RA value by this amount.
mov		temp3,temp
ldi		temp,0xDA
mov		temp4,temp
ldi		temp,0x16
mov		temp5,temp

lds		temp,RA_COUNT
lds		temp1,RA_COUNT+1
lds		temp2,RA_COUNT+2

tst		temp2
brmi	RA_NEGATIVE

sub		temp,temp3
sbc		temp1,temp4
sbc		temp2,temp5

tst		temp2
brmi	RA_OUT					;the stored value was less thamn RA_MAX, so don't change it.
rjmp	SAVE_RANGE_CHECKED_RA	;the stored value was greater than RA_MAX so save the reduced version.

RA_NEGATIVE:					;add RA max to make positive

add		temp,temp3
adc		temp1,temp4
adc		temp2,temp5

SAVE_RANGE_CHECKED_RA:

sts		RA_COUNT,temp
sts		RA_COUNT+1,temp1
sts		RA_COUNT+2,temp2

RA_OUT:

pop		temp5
pop		temp4
pop		temp3
pop		temp2
pop		temp1
pop		temp

ret

GET_DEC_FROM_DEC_COUNT:					;convert microstep count into a DEG:MM:SS

push	temp
push	temp1
push	temp2
push	temp3
push	temp4
push	temp5

;Divide by 0x5A5 to get Degrees

ldi		decimal,0xC0							;0x5A5
mov		temp3,decimal
ldi		decimal,0xF3
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

lds		temp,DEC_COUNT
lds		temp1,DEC_COUNT+1
lds		temp2,DEC_COUNT+2

	clr		decimal						;for result
SKIP100:
	inc		decimal
	sub		temp,temp3
	sbc		temp1,temp4
	sbc		temp2,temp5
	brpl	SKIP100						;keep incrementing decimal until reult is negative
	dec	decimal
	sts		DECLINATION+2,decimal			;save degrees
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5					;add back in to get remainder

;Divide remainder by 0x18 to get Minutes

ldi		decimal,0x18							;0x18
mov		temp3,decimal
ldi		decimal,0x00
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

	clr		decimal						;for result
SKIP101:
	inc		decimal
	sub		temp,temp3
	sbc		temp1,temp4
	sbc		temp2,temp5
	brpl	SKIP101						;keep incrementing decimal until reult is negative
	dec	decimal
	sts		DECLINATION+1,decimal			;save minutes
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5					;add back in to get remainder

;Multiply by 2.5 to get seconds			;input has to fit in one byte

	mov		decimal,temp				;duplicate
	lsr		temp						;times 0.5
	lsl		decimal						;times 2
	add		decimal,temp				;times 2.5
	sts		DECLINATION,decimal			;save seconds

pop		temp5
pop		temp4
pop		temp3
pop		temp2
pop		temp1
pop		temp

ret

GET_RIGHT_ASC_FROM_RA_COUNT:					;convert microstep count into a HH:MM:SS

push	temp
push	temp1
push	temp2
push	temp3
push	temp4
push	temp5

;Divide by 0x4920 to get Hours

ldi		decimal,0xC0							;0xF3C0
mov		temp3,decimal
ldi		decimal,0xF3
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

lds		temp,RA_COUNT
lds		temp1,RA_COUNT+1
lds		temp2,RA_COUNT+2

	clr		decimal						;for result
SKIP400:
	inc		decimal
	sub		temp,temp3
	sbc		temp1,temp4
	sbc		temp2,temp5
	brpl	SKIP400						;keep incrementing decimal until reult is negative
	dec	decimal
	sts		RIGHTASC+2,decimal			;save hours
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5					;add back in to get remainder

;Divide remainder by 0x410 to get Minutes

ldi		decimal,0x10							;0x410
mov		temp3,decimal
ldi		decimal,0x04
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

	clr		decimal						;for result
SKIP401:
	inc		decimal
	sub		temp,temp3
	sbc		temp1,temp4
	sbc		temp2,temp5
	brpl	SKIP401						;keep incrementing decimal until reult is negative
	dec	decimal
	sts		RIGHTASC+1,decimal			;save minutes
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5					;add back in to get remainder

;Divide remainder by 0x11 to get seconds

ldi		decimal,0x11							;0x11
mov		temp3,decimal
ldi		decimal,0x00
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

	clr		decimal						;for result
SKIP402:
	inc		decimal
	sub		temp,temp3
	sbc		temp1,temp4
	sbc		temp2,temp5
	brpl	SKIP402						;keep incrementing decimal until reult is negative
	dec	decimal
	sts		RIGHTASC,decimal			;save seconds
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5					;add back in to get remainder

pop		temp5
pop		temp4
pop		temp3
pop		temp2
pop		temp1
pop		temp

ret

GET_RA_COUNT_FROM_RIGHT_ASC:					;convert HH:MM:SS into microsteps

push	temp
push	temp1
push	temp2
push	temp3
push	temp4
push	temp5

;Multiply Hours by 0xF3C0

ldi		decimal,0xC0							;0xF3C0
mov		temp3,decimal
ldi		decimal,0xF3
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

clr		temp
clr		temp1
clr		temp2

	lds		decimal,RIGHTASC+2					;number of hours
SKIP200:
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5							;add an hour
	dec		decimal
	brne	SKIP200

;Add 0x410 to get Minutes

ldi		decimal,0x10							;0x410
mov		temp3,decimal
ldi		decimal,0x04
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal
	lds		decimal,RIGHTASC+1					;number of minutes
SKIP201:
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5							;add a minute
	dec		decimal
	brne	SKIP201

;add 0x11 to get seconds

ldi		decimal,0x11							;0x11
mov		temp3,decimal
ldi		decimal,0x00
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

	lds		decimal,RIGHTASC					;number of seconds
SKIP202:
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5							;add a second
	dec		decimal
	brne	SKIP202

	sts		RA_COUNT,temp						;save result
	sts		RA_COUNT+1,temp1
	sts		RA_COUNT+2,temp2

pop		temp5
pop		temp4
pop		temp3
pop		temp2
pop		temp1
pop		temp

ret

GET_DEC_COUNT_FROM_DECLINATION:					;convert DEG:MM:SS into microsteps

push	temp
push	temp1
push	temp2
push	temp3
push	temp4
push	temp5

;Multiply degrees by 0x5A5

ldi		decimal,0xA5							;0x05A5
mov		temp3,decimal
ldi		decimal,0x05
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal

clr		temp
clr		temp1
clr		temp2

	lds		decimal,DECLINATION+2					;number of degrees
SKIP300:
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5							;add a degree
	dec		decimal
	brne	SKIP300

;0x18 to get Minutes

ldi		decimal,0x18							;0x18
mov		temp3,decimal
ldi		decimal,0x00
mov		temp4,decimal
ldi		decimal,0x00
mov		temp5,decimal
	lds		decimal,DECLINATION+1					;number of minutes
SKIP301:
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5							;add a minute
	dec		decimal
	brne	SKIP301

;Multiply by 0.4 to get seconds

	push	temp
	push	temp1
	push	temp2
	clr		temp
	clr		temp1
	clr		temp2

	lds		temp3,102								;number of seconds (0.4 x 256)
	clr		temp4
	clr		temp5
	lds		decimal,DECLINATION					;number of seconds
SKIP302:
	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5								;add a second
	dec		decimal
	brne	SKIP302

	mov		temp3,temp1							;move result/256 across
	mov		temp4,temp2
	clr		temp5

	pop		temp2
	pop		temp1
	pop		temp

	add		temp,temp3
	adc		temp1,temp4
	adc		temp2,temp5								;add a second

		sts		DEC_COUNT,temp						;save result
	sts		DEC_COUNT+1,temp1
	sts		DEC_COUNT+2,temp2

pop		temp5
pop		temp4
pop		temp3
pop		temp2
pop		temp1
pop		temp

ret

SET_REALTIME:		;this is where RTC module setting will go	

ret

GET_REALTIME:		;This is where RTC module read will go

ret

PRINT_RIGHT_ASCENSION:
	TAB 20,6
	lds		temp,RIGHTASC+2
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,RIGHTASC+1
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,RIGHTASC
	rcall	PRINT99
	ret

PRINT_DECLINATION:
	lds		temp1,DECLINATION+2

	ldi		temp,'+'				;this bit prints a + or - ahead of the declination (range +/- 90)
	tst		temp1
	brpl	SKIP34
	ldi		temp,'-'
SKIP34:
	rcall	OSWRCH
	mov		temp,temp1
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,DECLINATION+1
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,DECLINATION
	rcall	PRINT99
	ret

PRINT_BATTERY:
	lds		temp,VOLTAGE+1
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,VOLTAGE
	rcall	PRINT99
	ldi		temp,'V'
	rcall	OSWRCH
	ret

PRINT_DATE:
	lds		temp,DATE+2
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,DATE+1
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,DATE
	rcall	PRINT99
	ret

PRINT_UTC:
	lds		temp,UTC+2
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,UTC+1
	rcall	PRINT99
	ldi		temp,':'
	rcall	OSWRCH
	lds		temp,UTC
	rcall	PRINT99
	ret

UPDATE_UTC:
		push	temp

		lds		temp,utc
		inc		temp
		sts		UTC,temp
		cpi		temp,60
		brlo	SKIP10
		clr		temp
		sts		UTC,temp
		lds		temp,UTC+1
		inc		temp
		sts		UTC+1,temp
		cpi		temp,60
		brlo	SKIP10
		clr		temp
		sts		UTC+1,temp
		lds		temp,UTC+2
		inc		temp
		sts		UTC+2,temp
		cpi		temp,24
		brlo	SKIP10
		clr		temp
		sts		UTC+2,temp

;We have rolled into a new day... so have to update the date

SKIP10:
	pop		temp
	ret

	lds	temp,ADCL
	lds	temp1,ADCH
	clr	temp1
	ldi	decimal,0x04
	rcall	PRINT_NUMBER
	rcall OUTPUT_PS_STRING
.db	" Volts     ",0x00
	ret

PRINT99:			;prints a number up to 99 with a leading zero (as we mostly don't need to go beyond 90 for this lark
	;temp - the number
	push	temp
	push	temp1

	mov		temp1,temp
	ldi		temp,'0'-1		;ASCII '0'-1
SKIP38:
	inc		temp
	subi	temp1,10
	brpl	SKIP38			;loop as many times as will go, plus 1
	subi	temp1,256-10	;put extra byte back, temp1 now contains remainder temp 1 ascii for tens
	rcall	OSWRCH
	ldi		temp,'0'-1
SKIP39:
	inc		temp
	dec		temp1
	brpl	SKIP39
	rcall	OSWRCH

	pop		temp1
	pop		temp
	ret

	PRINT_NUMBER:		;generic print of two-byte HEX as decimal
;	temp1		;HIGH byte
;	temp		;LOW byte
	push	temp
	push	temp1
	push	temp2
	push	temp3

	cbr	flags,(1<<lead_zero)	;supress leading zeroes
	ldi	temp2,0x10		;
	ldi	temp3,0x27		;hex 10,000
	rcall	DIVIDE_LINE

	ldi	temp2,0xE8		;
	ldi	temp3,0x03		;hex 1,000
	rcall	DIVIDE_LINE

	ldi	temp2,0x64		;
	ldi	temp3,0x00		;hex 100
	rcall	DIVIDE_LINE

	ldi	temp2,0x0A		;
	ldi	temp3,0x00		;hex 10
	rcall	DIVIDE_LINE

	sbr	flags,(1<<lead_zero)	;never supress units zero
	ldi	temp2,0x01		;
	ldi	temp3,0x0		;hex 1

	rcall	DIVIDE_LINE
	pop	temp3
	pop	temp2
	pop	temp1
	pop	temp
	ret

DIVIDE_LINE:
	dec	decimal
	brne	SKIP27
	sbr	flags,(1<<lead_zero)	;zero before DP
SKIP27:
	ldi	data,'0'-1		;ASCII '0'-1
SKIP28:
	inc	data
	sub	temp,temp2
	sbc	temp1,temp3
	brpl	SKIP28		;loop as many times as will go, plus 1
	add	temp,temp2
	adc	temp1,temp3		;put extra byte back
	sbrc	flags,lead_zero
	rjmp	OUTPUT_LINE_DIGIT	;Leading zero supression off
	cpi	data,'0'	;is this a zero?
	breq	LEADING_ZERO
	sbr	flags,(1<<lead_zero)	;no, output char and set flag
OUTPUT_LINE_DIGIT:
	rcall	OSWRCH
	cpi	decimal,0x00
	brne	LEADING_ZERO
	ldi	data,'.'
	rcall	OSWRCH
LEADING_ZERO:
	ret

BEEP:
;	sbi	DDRD,SOUND
;	WAIT	80
;	cbi	DDRD,SOUND
;	ret

	ADC_COMP:			;An analogue conversion has been completed

	in	status, SREG
	push	temp
	push	temp1
	push	decimal

	lds	temp,ADCL
	lds	temp1,ADCH

	lsl	temp
	rol	temp1
	lsl	temp
	rol	temp1			;Multiply ADFC value by 8 full scale of 16 volts for top byte.

;Now how to scale temp to 0-100
	lsr	temp			;0-128 step 2
	lsr	temp			;0-64 step
	mov	decimal,temp
	lsr	decimal			;0-32 step 1
	add	temp,decimal	;0-96 step 3, which maxes the resolution (3%) with max 1% error
	lsr	decimal			;0-8
	lsr	decimal			;0-4
	lsr	decimal			;0-2
	add	temp,decimal	;0-98
	lsr	decimal			;0-1
	add	temp,decimal	;0-99	- with 3 & 4 unit steps

	sts	VOLTAGE,temp
	sts	VOLTAGE+1,temp1

	pop	decimal
	pop	temp1
	pop	temp
	out	SREG,status

	reti

inescapable_wait:

	cbr	flags,1<<tick
LOOP40:
	sbrs	flags,tick
	rjmp	LOOP40
	cbr	flags,1<<tick
	dec	delay
	brne	LOOP40
	ret

fourteen_NOPS: ;with the rcall and the ret it's sixteen cycles
nop
nop
nop
nop
nop
nop
nop
ret

;****************************

OSWRCH:		; Start transmission of data (temp)
	out SPDR,temp
Wait_Transmit:
; Wait for transmission complete
	in	temp,SPSR
	sbrs temp,SPIF
	rjmp Wait_Transmit
	ret

OUTPUT_PS_STRING:			;prints a string from program memory, ends in null
	pop	ZH
	pop	ZL				;get next place off stack
	lsl	ZL
	rol	ZH				;shift left by one bit
SKIP12:
	lpm temp,Z+
	tst	temp
	breq	SKIP11
	rcall	OSWRCH			;output character
	rjmp	SKIP12

SKIP11:
	adiw	Z,0x01			;dummy to ensure right address
	lsr	ZH
	ror	ZL				;shift right one bit
	push	ZL
	push	ZH
	ret

;****************************

FORWARD_TABLE:

.db	HIGH(29458),LOW(29458)	;2
.db	HIGH(19639),LOW(19639)	;3
.db	HIGH(7364),LOW(7364)	;8
.db	HIGH(3682),LOW(3682)	;16
.db	HIGH(921),LOW(921)		;64
.db	HIGH(460),LOW(460)		;128
.db	HIGH(230),LOW(230)		;256
.db	HIGH(196),LOW(196)		;300

REVERSE_TABLE:

.db	HIGH(58916),LOW(58916)	;1
.db	HIGH(58916),LOW(58916)	;1
.db	HIGH(7364),LOW(7364)	;8
.db	HIGH(3682),LOW(3682)	;16
.db	HIGH(921),LOW(921)		;64
.db	HIGH(460),LOW(460)		;128
.db	HIGH(230),LOW(230)		;256
.db	HIGH(196),LOW(196)		;300

;******************Display Stuff

TEXTSIZE:

ldi		temp,27
rcall	OSWRCH
ldi		temp,184
rcall	OSWRCH
mov		temp,data
rcall	OSWRCH
clr		temp
rcall	OSWRCH
ret

HIDE_CURSOR:

ldi		temp,27
rcall	OSWRCH
ldi		temp,154
rcall	OSWRCH
clr		temp
rcall	OSWRCH
clr		temp
rcall	OSWRCH
ret

DRAW_BITMAP:

ldi	ZL,LOW(BITMAP<<1)
ldi	ZH,HIGH(BITMAP<<1)

ldi	temp1,LOW(1024)
ldi data,HIGH(1024)

SKIP209:
lpm		temp,Z+
rcall	OSWRCH
wait 1
dec	temp1
cpi temp1,0xFF
brne	SKIP209
dec data
cpi data,0xFF
brne	SKIP209

RET

CLEAR_SCREEN:
ldi		temp,12
rcall	OSWRCH
ret

;DISPLAY SCREENS

FRAME_TRACKING_DISPLAY:

TEXT_COLOUR	1
rcall	CLEAR_SCREEN
TEXT_SIZE 4
TAB	0,0
rcall OUTPUT_PS_STRING
.db	"Right Ascension",0x00
TAB	0,1
rcall OUTPUT_PS_STRING
.db	"Declination",0x00
TAB	0,2
rcall OUTPUT_PS_STRING
.db	"Date",0x00
TAB	0,3
rcall OUTPUT_PS_STRING
.db	"Universal Time",0x00
TAB	0,4
rcall OUTPUT_PS_STRING
.db	"Local Time",0x00
TAB	0,5
rcall OUTPUT_PS_STRING
.db	"Object",0x00
;Row 6 object name no fixed text
TAB 0,7
rcall OUTPUT_PS_STRING
.db	"Status",0x00
TAB 16,7
rcall OUTPUT_PS_STRING
.db	"Bat",0x00

ret

UPDATE_TRACKING_DISPLAY:

TEXT_COLOUR	1
TEXT_SIZE 8

TAB 8,0
rcall	PRINT_RIGHT_ASCENSION

TAB	7,1
rcall	PRINT_DECLINATION

TAB	8,2
rcall	PRINT_DATE

TAB	8,3	

rcall	PRINT_UTC

TAB	10,7
rcall	PRINT_BATTERY

ret

;******************************************************************
;FLASH (CONSTANT) Data block
;all constants little endian

;BITMAP DATA (Jupiter)
BITMAP:
.db 19,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,255,127,255,255,223,191,127,255,255,223,127,191,255,255,255,127,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,255,223,119,127,191,219,239,55,190,27,115,190,143,243,77,183,87,168,215,55,89,16,39,28,183,75,52,141,110,19,174,87,147,110,183,11,255,91,175,223,127,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,223,255,255,91,223,123,237,31,214,187,149,111,149,82,45,198,51,36,19,170,17,4,138,21,2,136,69,136,130,69,162,65,144,98,161,28,16,29,28,19,176,116,222,15,118,60,174,181,94,187,223,111,187,223,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,191,119,26,123,173,214,17,147,228,155,98,29,172,210,97,152,225,112,152,11,248,52,42,148,120,30,23,72,151,26,38,139,5,42,9,7,73,2,5,0,130,17,33,4,144,9,136,65,44,68,33,150,228,26,211,230,187,219,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,111,189,191,111,214,63,235,22,47,215,18,47,165,10,39,17,66,9,4,137,0,36,128,68,128,64,130,96,16,160,160,80,8,16,145,14,24,148,9,80,76,42,81,54,184,12,57,54,155,125,139,44,223,47,218,95,237,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,235,255,236,179,125,214,233,186,213,234,180,89,234,117,74,180,17,90,36,91,36,91,36,74,25,144,9,84,136,38,9,144,38,72,146,14,157,6,75,150,65,145,10,20,50,21,228,123,148,237,246,251,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,247,238,217,247,236,179,84,187,21,244,76,163,216,12,177,74,228,178,217,164,250,96,186,216,110,178,216,110,93,178,18,191,198,185,247,212,251,246,251,253,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,253,255,255,253,251,254,251,253,253,254,253,255,252,255,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255
.db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255

;******************************************************************
;SRAM Data block

;All data little endian

.dseg

ADDER:	.byte	4

millisecond_count:	.byte	1	;hundredths of a second

tenths_count:		.byte	1	;tenths of a second

RIGHTASC:		.byte 3		;HH,MM,SS

DECLINATION:		.byte 3		;HH,MM,SS

UTC:			.byte 3		;HH,MM,SS

DATE:			.byte 3		;DD:MM:YY

LOCALT:			.byte 3		;HH,MM,SS

SIDEREALT:		.byte 3		;HH,MM,SS

RUNTIME:		.byte 3		;HH,MM,SS	Time since power on

VOLTAGE:		.byte 2		;Volts

RA_COUNT:		.byte	3	;449280 steps = 1 rotation at ~ 2.88 arc-seconds per microstep

DEC_COUNT:		.byte 3		;

 

It's me again...

Last Edited: Mon. Apr 4, 2016 - 01:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stub_Mandrel wrote:
Arefis bno longer connected to AVcc -it is left floating and has a 100n cap to ground.

Well that should solve any "inappropriate" VREF configuration problems.    Does it solve your "big" current?

 

This would have caused the internal 2.56V voltage to be shorted to the 5V rail.   Not good.

	;Initialise ADC AVCC internal 2.56 bandgap with cap on AREF left adjust single ended input on pin 7
	ldi	temp,(1<<REFS1)|(1<<REFS0)|(0<<ADLAR)|(0<<MUX4)|(0<<MUX3)|(1<<MUX2)|1<<MUX1|1<<MUX0
	sts	ADMUX,temp

It is very unlikely that anyone is going to build your project.   The hardware is too unusual.

It is probably wiser to attach the schematic as a PDF and the code as a ZIP or ASM file.

 

I have no intention of going over your code with a fine tooth comb,   but someone might.

 

David.

Last Edited: Mon. Apr 4, 2016 - 02:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

I have no intention of going over your code with a fine tooth comb,   but someone might.

 

I'm not particularly worried about that (although it would suite a 3D printer) - but I wasn't really sure what Clawson was wanting to check...

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Well that should solve any "inappropriate" VREF configuration problems.    Does it solve your "big" current?

OP: So, does it?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Joey,

 

I would not hold your breath.

He won't even confirm whether he is using a DS1302, DS1203, DS1307, ...

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Joey,

 

I would not hold your breath.

He won't even confirm whether he is using a DS1302, DS1203, DS1307, ...

 

David.

 

The clue was in my thread title which started with the part number DS1203....

 

:-)

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

david.prentice wrote:

Well that should solve any "inappropriate" VREF configuration problems.    Does it solve your "big" current?

OP: So, does it?

 

Sorry both, i did type a response to this but it doesn't seem to have appeared.

 

I disconnected Aref from Vcc before changing the code to use the internal reference.

 

The problem isn't with the AVR - the current increases and stays there when I reset the one Pololu on the board, which is really odd as it hasn't got a stepper attached to it and the pins are not shorted :-/

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stub_Mandrel wrote:
The clue was in my thread title which started with the part number DS1203....

My copy of the forum software must be faulty then. When I view this thread the forum software tells me the thread title is "How greedy are A/D converters?" - nothing there about DS1xxx model numbers?!?

 

Or were you talking about this:

 

https://www.avrfreaks.net/forum/d...

 

Are you really expecting everyone reading here to go away and read every other thread you've started before contributing to this thread?

Last Edited: Thu. Apr 7, 2016 - 03:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stub_Mandrel wrote:
The clue was in my thread title which started with the part number DS1203....

An LG battery?

 

So you >>still<< have not answered...

 

david.prentice wrote:
He won't even confirm whether he is using a DS1302, DS1203, DS1307, ...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Stub_Mandrel wrote:

The clue was in my thread title which started with the part number DS1203....

 

My copy of the forum software must be faulty then. When I view this thread the forum software tells me the thread title is "How greedy are A/D converters?" - nothing there about DS1xxx model numbers?!?

 

Or were you talking about this:

 

https://www.avrfreaks.net/forum/d...

 

Are you really expecting everyone reading here to go away and read every other thread you've started before contributing to this thread?

 

I don't want to start a flame war, but Dave Prentice referenced the other thread (where folks have started questioning which chip I'm using for some unfathomable reason) and referenced that thread here. See higher up...

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:

Stub_Mandrel wrote:
The clue was in my thread title which started with the part number DS1203....

An LG battery?

 

So you >>still<< have not answered...

 

david.prentice wrote:
He won't even confirm whether he is using a DS1302, DS1203, DS1307, ...

 

With respect, if someone says they have a problem with oranges, and then mention 'oranges' four or five times, it seems a bit weird to keep asking them if they have an apple or an orange?

 

I have confirmed which part I have, but you will have to check the other thread to find out ;-)

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stub_Mandrel wrote:
I have confirmed which part I have, but you will have to check the other thread to find out

Do you think I should merge these two threads so all the information is in one place?

 

Moderator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Stub_Mandrel wrote:

I have confirmed which part I have, but you will have to check the other thread to find out

 

Do you think I should merge these two threads so all the information is in one place?

 

Moderator.

 

I've caused you enough problems already.

 

I suggest locking this one and letting it die quietly. It turned out the problem wasn't with the AVR, toggling reset on a Pololu stepper board is making it eat milliamps.

 

It will only make the other thread worse than the mess it already is.

 

unless you want to merge them and re-title "Please avoid this thread".

 

Irony is I moderate another forum, and this sort of confusion is exactly what I dread..

 

Neil

It's me again...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Locked it is then :-)

Topic locked