Author 
Message 
Topic: ATTiny44 ADC reference selection 
jasreb
Replies: 10
Views: 1729

Forum: BASCOMAVR Archive Posted: Fri Oct 05, 2007 2:05 pm Subject: ATTiny44 ADC reference selection 
Hi there (again!)
I am trying to change the ADC reference in Bascom for an ATTiny44.
If I use
Config Adc = Single , Prescaler = 16 , Reference = 0
or simply
Config Adc = Single , P ... 
Topic: ATTiny44 temperature measurement 
jasreb
Replies: 0
Views: 139

Forum: BASCOMAVR Archive Posted: Fri Oct 05, 2007 1:58 pm Subject: ATTiny44 temperature measurement 
Hi there
I am trying to use the internal temperature measurement facility of the ATTiny44. According to the Atmel data sheet, this is selected via ADC channel 8.
I have tried using:
Vadc=Get ... 
Topic: simulator help 
jasreb
Replies: 1
Views: 122

Forum: BASCOMAVR Archive Posted: Fri Oct 05, 2007 1:01 pm Subject: simulator help 
At risk of sounding like a complete muppet, can someone point me in the direction of some useful info for getting started using the simulator? The help file seems pretty unhelpful, I was just wonderin ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Fri Oct 05, 2007 12:53 pm Subject: maths modulo question 
Strangely enough, reverting to using " /256 " results in less compiled code than 2lines with a "Shift R,8" command followed by "var1 = var2"
Config Adc = Single , Prescaler = 16 ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Fri Oct 05, 2007 12:32 pm Subject: maths modulo question 
this is the neatest/most compact compiled I have come up with so far:
Config Adc = Single , Prescaler = 16 ', Reference = vcc
Start Adc
Dim Vadc As Word ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Fri Oct 05, 2007 12:13 pm Subject: maths modulo question 
You have 2 multiplies by 5, two divisions by 256, and a mult by 100 to do this numerically. If you did it in strings it could look something like this:
Vbatt = Vadc * 500 'scale up to voltage * 10 ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Thu Oct 04, 2007 5:17 pm Subject: maths modulo question 
You are correct, Format wont do that. But you could as easily use the Left and Mid or Right string operations to chop the numbers up, after converting to strings. I suspect the string operations are ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Thu Oct 04, 2007 2:40 pm Subject: maths modulo question 
Hi,
There is no Hardware Multiplier in an ATtiny44.
See Parametric Product Table:
http://www.atmel.com/dyn/products/param_table.asp?family_id=607&OrderBy=part_no&Direction=ASC
Try th ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Thu Oct 04, 2007 2:34 pm Subject: maths modulo question 
Hi,
There is no Hardware Multiplier in an ATtiny44.
See Parametric Product Table:
http://www.atmel.com/dyn/products/param_table.asp?family_id=607&OrderBy=part_no&Direction=ASC
Try th ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Thu Oct 04, 2007 8:21 am Subject: maths modulo question 
Hi,
I just testet your code on mega8 & 16 it works fine
can it be the attiny44.dat that dont work or your 1.11.8.7 ?
hmm that's interesting.. I'm assuming there must be a compiler bug the ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Thu Oct 04, 2007 8:19 am Subject: maths modulo question 
I cant see what is wrong with your code, but there is a builtin way of scaling an integer to display a fixed number of decimals. Look up the Format command in Bascom Help.
Essentially you calcula ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Thu Oct 04, 2007 1:19 am Subject: maths modulo question 
Hi
thanks for the reply  I thought of that, but it seems a bit tedious to create a table with that many entries for a problem that should be fairly simple to solve mathematically.
The code does ... 
Topic: maths modulo question 
jasreb
Replies: 16
Views: 689

Forum: BASCOMAVR Archive Posted: Wed Oct 03, 2007 11:50 pm Subject: maths modulo question 
hi there
I am trying to measure a battery pack voltage (020V) and display the result in the form xx.yy where xx = units and yy = decimals, ie 15.65V would give xx = 15 and yy = 65.
I have a 1: ... 
Topic: modulo maths question 
jasreb
Replies: 0
Views: 118

Forum: BASCOMAVR Archive Posted: Wed Oct 03, 2007 11:44 pm Subject: modulo maths question 
hi there
I am trying to measure a battery pack voltage (020V) and display the result in the form xx.yy where xx = units and yy = decimals, ie 15.65V would give xx = 15 and yy = 65.
I have a 1: ... 
Topic: pwm code problems with ATtiny13 and 15 
jasreb
Replies: 8
Views: 2007

Forum: BASCOMAVR Archive Posted: Wed Jan 05, 2005 10:18 am Subject: pwm code problems with ATtiny13 and 15 
Still wondering  does anybody have any idea why Bascom 'pwm' does not work with ATtiny13? Is it just not implemented (yet) or am I missing something obvious?
Failing that, does anyone have some s ... 
