Author |
Message |
Topic: Timer Counter Question |
Visovian
Replies: 16
Views: 8020
|
Forum: BASCOM-AVR Unsupported versions Posted: Fri Jul 28, 2017 8:29 pm Subject: Timer Counter Question |
Hi Goorman,
You are right. Good eye.
Of course it should be
Frequency = Counter0_ovf_count * 256
I did not test it in real.
Why do you not use timer1 for counting pulses? |
Topic: Timer Counter Question |
Visovian
Replies: 16
Views: 8020
|
Forum: BASCOM-AVR Unsupported versions Posted: Fri Jul 28, 2017 9:54 am Subject: Timer Counter Question |
Not bad for a beginner.
There is some inaccuracy in measuring at high frequencies.It is because you count pulses not for 1 sec, but for 122*0.8192 = 999,424 ms.
So your result is 1/1000 less than ... |
Topic: ATTINY85 USI I2C Master - error 202 - .EQU not found |
Visovian
Replies: 3
Views: 653
|
Forum: BASCOM-AVR Posted: Thu Jul 27, 2017 5:00 am Subject: ATTINY85 USI I2C Master - error 202 - .EQU not found |
Attiny85 has not registers UBRR, UCR.
You can use the software UART.
See the command OPEN in Bascom-help. |
Topic: Timer Counter Question |
Visovian
Replies: 16
Views: 8020
|
Forum: BASCOM-AVR Unsupported versions Posted: Tue Jul 25, 2017 8:05 am Subject: Timer Counter Question |
PostPosted: Sun Jul 23, 2017 8:31 pm Post subject: Simple frequency meter on Atmega8
Simple frequency meter on Atmega8
It's my first code.
And where is the measured frequency in your code?
T ... |
Topic: Printbin arrays with variable length |
Visovian
Replies: 7
Views: 698
|
Forum: BASCOM-AVR Posted: Tue Jul 11, 2017 6:35 am Subject: Printbin arrays with variable length |
$regfile = "m328def.dat"
$crystal = 16000000
$baud = 115200
Dim Buffer(255) As Byte
Dim I As Byte
For I = 1 To 110
Buffer(i) = I + "A"
Next
'''''''''' ... |
Topic: String to long |
Visovian
Replies: 14
Views: 709
|
Forum: BASCOM-AVR Posted: Fri Jun 30, 2017 3:34 pm Subject: String to long |
In your example - what happens if you pass mem2 to the sub , and in the sub, print message?
Do you get ABCDE12345 ? or does it cause a problem?
Try yourself.
1. Compile
2. Run simulator
h ... |
Topic: String to long |
Visovian
Replies: 14
Views: 709
|
Forum: BASCOM-AVR Posted: Fri Jun 30, 2017 7:18 am Subject: String to long |
What happens if the passed string is longer than the declared length in the declaration? Does the copy simply get truncated, or is memory space overwritten, with unpredictable results?
Nothing bad ... |
Topic: Error 337 - No more space for Labels and TIMSK RC5 problem |
Visovian
Replies: 3
Views: 524
|
Forum: BASCOM-AVR Posted: Mon Jun 12, 2017 1:31 pm Subject: Error 337 - No more space for Labels and TIMSK RC5 problem |
error 337 - No more space for labels
What is your $stacks setting? |
Topic: UART Communication between two ATMEGA164P |
Visovian
Replies: 10
Views: 869
|
Forum: BASCOM-AVR Posted: Thu Jun 01, 2017 7:41 am Subject: UART Communication between two ATMEGA164P |
Then search for the fault in hardware. |
Topic: UART Communication between two ATMEGA164P |
Visovian
Replies: 10
Views: 869
|
Forum: BASCOM-AVR Posted: Wed May 31, 2017 6:41 am Subject: UART Communication between two ATMEGA164P |
Dim S As Single
Dim B As Byte
''''''''''''''''''''''''''''
Do
B = Ischarwaiting(#1)
If B = 1 Then
Input #1 , S
Print #2 , "number = " ; S
End If
... |
Topic: Timer usage |
Visovian
Replies: 1
Views: 585
|
Forum: BASCOM-AVR Posted: Sat May 13, 2017 8:17 am Subject: Timer usage |
You can use Timer0 in CTC mode.
In this mode the timer counts only to OCR0A value, not to 255, and then clears to 0.
When it reaches OCR0A value, the interrupt COMPARE0A occures (if enabled).
'- ... |
Topic: Waitms doesn't work on ATtiny20 |
Visovian
Replies: 5
Views: 292
|
Forum: BASCOM-AVR Posted: Tue Nov 22, 2016 8:01 am Subject: Waitms doesn't work on ATtiny20 |
I tried to find registers R8 and R9 from the Register Summary but there were nothing named liked that.
In the Register sumary there are only IO registers.
R0, R1 ... R31 are General purpose worki ... |
Topic: Reverse order a string? |
Visovian
Replies: 14
Views: 587
|
Forum: BASCOM-AVR Posted: Mon Oct 10, 2016 7:26 am Subject: Reverse order a string? |
From
http://www.developerfusion.com/code/2196/reverse-string/
Adapted.
Function Reversestring(stext As String) As String
Dim Lentext As Byte
Dim Lpos As Byte
Dim Btemp As Byte
... |
Topic: EEprom access using pointers and tables |
Visovian
Replies: 9
Views: 684
|
Forum: BASCOM-AVR Posted: Mon Jun 06, 2016 6:14 am Subject: EEprom access using pointers and tables |
deleted |
Topic: attiny13 adc to pwm |
Visovian
Replies: 25
Views: 2099
|
Forum: BASCOM-AVR Posted: Sat Mar 26, 2016 6:52 am Subject: attiny13 adc to pwm |
You can also try
' Brightness of Led on PB0 is controled by potentiometer on PB3
$regfile = "attiny13.dat"
$crystal = 9600000
$hwstack = 16
$swstack = 16
$framesize = 8
Dim Adc_va ... |
|