Hi.
I wrote the beginning of the program:
[code:1:8016b589b8]
$regfile = "m32def.dat"
Lcdport Alias Portc
R_s Alias Portc.4
E_e Alias Portc.5
D_b4 Alias Portc.0
D_b5 Alias Portc.1
D_b6 Alias Portc.2
D_b7 Alias Portc.3
'__________________
Config Lcdport = Output
Config Lcdpin = Pin , Rs = R_s , E = E_e , Db4 = D_b4 , Db5 = D_b5 , Db6 = D_b6 , Db7 = D_b7
Config Lcdmode = Port
Config Lcd = 16 * 2
Cursor Off
Cls
[/code:1:8016b589b8]
whith no error if i compiling.
His name is "c:bascomtoto.bas"
if I write this early in another program:
[code:1:8016b589b8]
$include "C:bascomtoto.bas"
dim x as byte
...
[/code:1:8016b589b8]
compilation is with errors:
[code:1:8016b589b8]
Error : 101 Line : 18 Can't find HW-register [DDRC] , in File : C:bascomtoto.bas
Error : 222 Line : 19 Illegal character [expected (, got '' [PORTC]] , in File : C:bascomtoto.bas
Error : 222 Line : 19 Illegal character [expected (, got '' [PORTC]] , in File : C:bascomtoto.bas
Error : 222 Line : 19 Illegal character [expected (, got '' [PORTC]] , in File : C:bascomtoto.bas
Error : 222 Line : 19 Illegal character [expected (, got '' [PORTC]] , in File : C:bascomtoto.bas
Error : 222 Line : 19 Illegal character [expected (, got '' [PORTC]] , in File : C:bascomtoto.bas
Error : 222 Line : 19 Illegal character [expected (, got '' [PORTC]] , in File : C:bascomtoto.bas
[/code:1:8016b589b8]
What is the error?
Thank you
[b:8016b589b8][color=red:8016b589b8](BASCOM-AVR version : 2.0.7.0 , Latest : 2.0.7.7 )[/b:8016b589b8][/color:8016b589b8]
↧
BASCOM-AVR : error with Aliases : NEWTOPIC
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
I assume you have an External Crystal attached to your micro?
Have you changed the Fuses to switch the micro's clock source to use the External Crystal?
If not, the micro is still running on its internal RC oscillator, (at 1 MHz, or whatever the data sheet says it is).
Be careful in changing the Fuses.
An external crystal is a two lead device, and uses two external capacitors.
This is probably what you have.
An external oscillator is a small module, with its own V+ and Ground pins, and it outputs a square wave. This is probably NOT what you have.
JC
↧
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
Thank you
JC
for your replay.
I don't connect external x-tal.
I use internal 9.6MHz rc by fuse H(FF) L(6A).
I think it have another way to generate high frequency by config Timer0.
Thanks again.
↧
Share your working BASCOM-AVR code here : Arduino Mega + 5 inch SSD1963 16 bit display : REPLY
Hello Ben
I just bought a 5.00 inches display, a itb2 arduino mega shield V2.1 from IDHead Studio and a Arduino 2560
your program is working fine ! =D> now i must try touch screen, and sd card
many thanks
just one think to say the 3.3 switch must be to 3.3V and you must use a extra alim because the all cards need more than 500Ma (usb maxi current)
JP :wink:
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
[quote:f2083e4adc="Debu"] adc_value = getadc(2)
friq_com=adc_value/4[/quote:f2083e4adc]
Hi Debu,
this will not do what you want, as friq_com will only get values from 0 .. 63
This would do:
adc_value = getadc(2) / 4
friq_com=adc_value
With COMPARE0A = 0 you will get a frequency of _XTAL/2, whatever _XTAL the µc is really running on.
↧
↧
BASCOM-AVR : error with Aliases : REPLY
The $REGFILE is not allowed in your include file. It must be in your main source code.
↧
BASCOM-AVR : error with Aliases : REPLY
Thank you very much.
Now it's ok.
↧
BASCOM-EDB : probleem met oplade EDB : REPLY
hi
when the LED is flashing, it means the bootloader is active. Why dont you use the bootloader?
- select programmer : MCS bootloader, 38400 baud. reset : DTR
- then press F4 and it should program the micro.
no need to use the stk programmer.
↧
BASCOM-AVR : Sniffing serial Lines with BASCOM Shiftin? : REPLY
you can not use the SPI because all lines are connected and it would disturb your radio.
but maybe you can try the slave mode. (see samplespi). and then only connect CS, clock and MOSI. do not connect MISO. it could work.
otherwise you need some asm code to fill the array. i can show it but best to first test spi.
↧
↧
Various : Please help to code Bascom : REPLY
if you just use it as transmitter you don't need the [i:60eca5a936]IF + - 10.7 mhz[/i:60eca5a936]
[code:1:60eca5a936]'$sim
$regfile = "M8def.dat"
$crystal = 8000000
$hwstack = 50
$swstack = 50
$framesize = 40
' konfigurasi pin LCD 16 * 2
Config Lcdpin = Pin , Db4 = Portd.2 , Db5 = Portd.3 , Db6 = Portd.4 , Db7 = Portd.5 , E = Portd.1 , Rs = Portd.0
Config Lcd = 16 * 2
Cursor Off Noblink
'----------------------------------------
' variabel pll
Config Portb.0 = Output 'CLOCK
Config Portb.1 = Output 'CE
Config Portb.2 = Output 'DATA
Portb.0 = 0
Portb.1 = 0
Portb.2 = 0
' Buttons SET , UP , DOWN
Config Portd.7 = Input 'Freq_set
Config Portd.6 = Input 'Freq_up
Config Portb.7 = Input 'Freq_dw
'lock input pin
Config Portb.6 = Input 'Lock_flag
'----------------------------------------------
'batas frequensi
Const Fmax = 1070
Const Fmin = 875
'---------------------------------------------------
'carakter panah LCD
Deflcdchar 0 , 32 , 4 , 2 , 31 , 2 , 4 , 32 , 32
Deflcdchar 1 , 32 , 4 , 8 , 31 , 8 , 4 , 32 , 32
'------------------------------------------------------
'sub declare
Declare Sub Write_veronica()
Declare Sub Freq_to_lcd()
Declare Sub Lock_detect()
Declare Sub Freq_up()
Declare Sub Freq_dw()
Declare Sub Freq_set()
Declare Sub Freq_limit()
Declare Sub Clock()
'---------
Declare Sub Voltase()
Declare Sub Watt()
'variabel pll
Dim Eeromfreq As Eram Word At &H10
Dim Savemode As Word
Dim Mainfreq As Word
Dim Lock_flag As Bit
Dim Set_flag As Bit
Dim Flag_lcd As Bit 'update lcd
Dim Schar As String * 6 'freq display
Dim A As Byte ' counter
Dim Freq As Word ' freqvence D0 - D13 LM7001
Dim Setup As Byte 'parameter B0,B1,B2,TB,R0,R1,R2,S
'-----------------------------------------------------------
Dim Read_adc As Word
Dim Volt As Single
Dim Watt_1 As Single
'---------------------------------------
Locate 1 , 10
Lcd " MHz"
Locate 1 , 8
Lcd Chr(0)
Locate 1 , 1
Lcd Chr(1)
Mainfreq = Eeromfreq
'---------------------------------------------
'isi loock flag
Lock_flag = Not Pinb.6
'----------------------------------------------
'load data awal
Call Freq_limit()
Call Write_veronica()
Call Freq_to_lcd()
'------------------------------------------------
'main loop
Do
Debounce Pind.6 , 0 , Freq_up , Sub
Debounce Pind.7 , 0 , Freq_set , Sub
Debounce Pinb.7 , 0 , Freq_dw , Sub
'update lcd
If Flag_lcd = 1 Then
Flag_lcd = 0
Locate 1 , 7
Lcd Schar
End If
Call Lock_detect()
Loop
End
'------------------------------------------------------
Sub Write_veronica()
Setup = &B10000000 ' 100khz &B10000000
Freq = Mainfreq
If Freq >= 875 And Freq <= 1070 Then ' 87.5 - 108.0 Mhz
Portb.0 = 0 ' CL=0
Portb.1 = 1 'CE
For A = 0 To 13 ' D0 - D13
If Freq.a = 1 Then
Portb.2 = 1 '1
Else
Portb.2 = 0 '0
End If
Call Clock()
Next A
Portb.2 = 0
Call Clock() ' T0=0
Portb.2 = 0
Call Clock()
For A = 0 To 7 ' parameter B0,B1,B2,TB,R0,R1,R2,S '
If Setup.a = 1 Then
Portb.2 = 1 '1
Else
Portb.2 = 0 '0
End If
Call Clock()
Next A '
Portb.1 = 0
End If
End Sub
Sub Clock()
Waitus 10
Portb.0 = 1
Waitus 10
Portb.0 = 0
Waitus 10
End Sub
'--------------------------------------------------------
' tampilkan frekuesni ke LCD
Sub Freq_to_lcd()
Schar = Str(mainfreq)
Schar = Format(schar , "00.0")
Flag_lcd = 1
Savemode = Mainfreq
Eeromfreq = Savemode
End Sub
' -----------deteksi lock -------------------
Sub Lock_detect()
If Pinb.6 <> Lock_flag Then
Lock_flag = Pinb.6
If Set_flag = 1 Then
Locate 1 , 1
Lcd " SET "
Else
If Lock_flag = 1 Then
Locate 1 , 1
Lcd " LOCK "
Else
Locate 1 , 1
Lcd "UNLOCK"
Waitms 50
End If
End If
End If
End Sub
'------------------------------------------------------
Sub Freq_up()
If Set_flag = 1 Then
Mainfreq = Mainfreq + 1
Call Freq_limit()
Call Write_veronica()
Call Freq_to_lcd()
End If
End Sub
'------------------------------------------------------
' frekuensi turun
Sub Freq_dw()
If Set_flag = 1 Then
Mainfreq = Mainfreq - 1
Gosub Freq_limit
Gosub Write_veronica
Gosub Freq_to_lcd
End If
End Sub
'-------------------------------------------------------
' set/enter frekuensi
Sub Freq_set()
If Set_flag = 0 Then
Set_flag = 1
Else
Set_flag = 0
End If
Lock_flag = Not Pinb.6
End Sub
'-------------------------------------------------------
' batas atas dan bawah frekuensi
Sub Freq_limit()
If Mainfreq > Fmax Then Mainfreq = Fmin
If Mainfreq < Fmin Then Mainfreq = Fmax
End Sub[/code:1:60eca5a936]
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
[quote:74b1f9e2f5]is it possible to generate 4MHz or 2MHz ????? [/quote:74b1f9e2f5]
You can get only frequencies
$crystal / 2
$crystal / 4
$crystal / 6
$crystal / 8
and so on
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
[quote:e547e892e4="Visovian"]With CTC you can get only frequencies
$crystal / 2
$crystal / 4
$crystal / 6
$crystal / 8
and so on[/quote:e547e892e4]
Using OSCCAL you get some of the the in-betweens. No guarantee of course, as this is heavily detuning of the internal RC out of specs.
But for hobby-use - who cares? :D
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
[quote:46135141b5="for_ro"][quote:46135141b5="Debu"] adc_value = getadc(2)
friq_com=adc_value/4[/quote:46135141b5]
Hi Debu,
this will not do what you want, as friq_com will only get values from 0 .. 63
This would do:
adc_value = getadc(2) / 4
friq_com=adc_value
With COMPARE0A = 0 you will get a frequency of _XTAL/2, whatever _XTAL the µc is really running on.[/quote:46135141b5]
Thank you
FOR_RO
for your replay
Now I get to 2.33 to 592.24KHz
↧
↧
BASCOM-AVR : Function generator Attiny13 : REPLY
Hurray
:lol:
Thanks to all
Now it is run 18.5KHz to 4.76MHz by fuse sating CKDIV8.
But,
wait
↧
BASCOM Project Blog : Building a Webserver with a Wiznet W5100 : REPLY
Now I have added a transmit buffer of 1000 characters we can not use one buffer for both transmit and receive as we need to search the received request and build a response depending what was requested there is still 3546 bytes of the 8K of ram left so still ok. Also note the double speed bit is set for SPI not all AVRs support this, what this does is run the SPI buss at half the cpu clock so M2560 = 8Mhz & M1284 = 10Mhz
Regards Paul
↧
BASCOM-AVR : xmega frequency meter with 32bit counter : REPLY
When I put low frequency the display value is high also
when I increase frequency the display shown low value.
So it is actually measure the pulse width, I want count the number of pulse.
Have you any idea ????????
↧
BASCOM-AVR : Create Excel File on SD Card Problem! : REPLY
dear Ajaxelectronic
Hello. I am new in this Forum!
I found your posts regarding excel file on a sd card.
I want to store a few temperature data ... from my pool solar controller onto an sd card too, to make a kind of data logger.
And it should be very easy to get it on the computer. Thats why I want to use sd cards.
I´ve never done anything with sd card before with bascom.
Would you be so kind to send me a working code for handling a sd card with bascom and working with an excel file.
Would be great!
THANKS a lot in advance
best regards
Andreas
↧
↧
BASCOM-AVR : Config KBD : NEWTOPIC
I have a project that has a 4x4 scanned keypad which consists of rubber keys with the
usual black conductive "pill" and interlocking golf pcb fingers. I occasionally get
some odd key press responses (incorrect code is returned) particularly if the button
is pushed fast. I have tried different debounce values.
I am curious how Config kbd sets up the inputs and outputs that comprise the rows and columns
and the timing of the scan. How exactly does that debounce value affect the operation?
Has anyone found a particular setup for this type of conductive keypad that works reliably?
Thanks in advance for your help.
[b:728baca617][color=red:728baca617](BASCOM-AVR version : 2.0.7.7 )[/b:728baca617][/color:728baca617]
↧
BASCOM-AVR : Create Excel File on SD Card Problem! : REPLY
Hi Jamie2
it is very very si,ple. you can refer to below page for step by step tutorial.
[url]http://members.aon.at/voegel/[/url]
[url]http://avrhelp.mcselec.com/index.html?avr_dos_file_system.htm[/url]
i attached my simple file too.
↧
BASCOM-AVR : Inputbin versus Inkey : REPLY
hello
the inputhex (with or without prompt ) function working in RS485 mode on all ports of XMEGA ?
because i try this function with rs485 on xmega com on portc and not working well
also give a bad number using inputhex with dword
regards
Mario
↧