Quantcast
Channel: MCS Electronics Forum
Viewing all 20606 articles
Browse latest View live

BASCOM-AVR : 2078 : REPLY

$
0
0
Hi Mark, I found something weird in the [b:75c0d0976f]FOR-NEXT[/b:75c0d0976f] command in this version 2.0.7.8, and I confirm that in the old 2.0.7.7 worked well ! This code works ok, and I have many circles : [code:1:75c0d0976f]For Paulo = 2 To 10 Step 1 Zahler = Paulo*10 Call Lcd_circle(160 , 120 , Zahler , Yellow) Next [/code:1:75c0d0976f] But in this code I have only one circle, appears like the [b:75c0d0976f]Step[/b:75c0d0976f] don't works right if value is different from 1 : [code:1:75c0d0976f]For Paulo = 20 To 100 Step 10 Zahler = Paulo Call Lcd_circle(160 , 120 , Zahler , Yellow) Next [/code:1:75c0d0976f] Both the codes must have the same behavior, but the last don't works. I tried with many different values for [b:75c0d0976f]Step[/b:75c0d0976f], and all don't work, I allways got only one circle. I have increased all $hwstack, $swstack and $framesize values, and the results are the same. Please you can confirm this ? Thanks ! Paulo

KokkeKat FAT-free SD card lib : Bugs and solutions - new and historic : REPLY

$
0
0
Hi. My settings in lib are; Const Sdinitdetail = 0 Const Sdfsactive = 1 Const Sdusefind = 0 Const Sdusefindstoreentry = 0 Const Sdusedirlist = 1 ' Use or don't use Const Sddirlistarraysize = 12 ' If used, set the size of the array that holds the cluster numbers Const Sdrmode = 1 Const Sdwmode = 2 Const Sduseappend =1 Const Sdcleartail = 0 Const Sdusefsinfo = 0 Const Sduselfn = 0 Const Sduselfncompare = 0 Const Sdusewipe = 0 Const Sdusedirlistdelete = 0 Const Sdusesizeinfo = 0 Const Sdusecrc7 = 0 ' This has no practical use in the library - use it if you want to add Program; gosub sdinit print sdstatus;" ";sdcardtype Sdentrynames = "log1501.txt" Sdcreatemode = 0 ' file Sdstartdirclusterd = 0 for root directory. Sdyear = 2015 'the year Sdmonth = 01 'the month Sdday = 02 'the day Sdhours = 17 'the hours Sdminutes = 33 'the minutes Sdseconds = 59 'the seconds Sdmseconds =234 'the milliseconds print "Creating file" Sdcreatemode = 0 ' Create file Sdstartdirclusterd = 0 gosub Sdcreatefileordir print sdstatus;" ";sdcardtype After SDinit I get SdStatus=0 and cardtype=3. So far so good. But calling the Sdcreatefileordir, programs never return, and I have to reset. Using Arduino Mega 16MHz, and Bascom 2.0.7.8.002 SD card is HC 4Gb, which have been formatted FAT and tested in PC.. Any ideas, any help?? Best regards svein

BASCOM-AVR : 2078 : REPLY

$
0
0
I try that and it is ok Version 2078 $regfile = "M328pdef.dat" $crystal = 16000000 Config Clockdiv = 1 $hwstack = 128 $swstack = 64 $framesize = 128 $baud = 19200 Config Submode = New Dim Paulo As Byte , Zahler As Word For Paulo = 20 To 100 Step 10 Zahler = Paulo Print Zahler Next maybe try to trace your sub ? Bon courage JP

BASCOM-AVR : submode=new + sub containing on : REPLY

$
0
0
[i:e0d33faaf4]timer_init()[/i:e0d33faaf4] is called, as shown in the code snippet above. the code snippet is incomplete: [i:e0d33faaf4]enable oc1a[/i:e0d33faaf4] is missing in [i:e0d33faaf4]timer_init[/i:e0d33faaf4], so it looks like the interupt sub might never be called, but the real code contains the [i:e0d33faaf4]enable oc1a[/i:e0d33faaf4]. the bug is, that with [i:e0d33faaf4]submode=new[/i:e0d33faaf4] the [i:e0d33faaf4]on oc1a timer1_intr[/i:e0d33faaf4] is ignored and no code is generated for [i:e0d33faaf4]sub timer1_intr()[/i:e0d33faaf4] and the interrupt vector for [i:e0d33faaf4]oc1a [/i:e0d33faaf4] is not set

BASCOM-AVR : 2078 : REPLY

$
0
0
Hi, Duval, Thanks for your reply. I'm using the routines posted in this Fórum to use the display ILI9341. And have to make them smaller to use with an Arduíno Uno, then I must use only two fonts. I'm testing the routines to draw lines and circles, and this bug has happened with the circles, that is using an variable to increment the radius of a circle. The curious is that I have the same results in the real hardware AND in the Proteus 8 Simulation. I attached all the code I'm using, then you can compile then and see in the simulator. The For-Next that start at line 86 only executes [b:2969790a2d]one time[/b:2969790a2d], and exit the loop with the variable [b:2969790a2d]Paulo=30[/b:2969790a2d] !! But the next For-Next that starts at line 94 runs perfectly, exiting the loop only when [b:2969790a2d]Paulo=7[/b:2969790a2d] !! I can't find what is wrong... Thanks for help me , Duval ! Paulo

BASCOM-AVR : 2078 : REPLY

$
0
0
I can confirm this is a bug. It will happen for words with a step only. As a work around use an integer or overlayed integer. The reason is that in 2078 i started to optimize code and the NEXT statement will create different code since it calls the internal add code as well. Instead of add/adc and loading registers with immediate values it will use subi/sbci but this will set different flags. We will make an update available for this.

KokkeKat FAT-free SD card lib : Append line of text to file. : REPLY

$
0
0
Great work and thanks for sharing! :-) Niclas

KokkeKat FAT-free SD card lib : Sdcreatefileordir problems.. : REPLY

$
0
0
Hi Svein, I have moved your posting to a separate thread. Could you please try the "Example_WRITE_FILE.bas" template code in the zip file that you find in thread "Latest release"? If I remember correctly, you must specify the filename in exactly that way (11 CAPITAL letters without the dot). Please also see "6.9.1 Initialization sequence" in the pdf document. You are missing the gosub Sdreadfsinfo call after calling Sdinit. I hope this will help. Cheers Niclas

BASCOM-AVR : for the fist of january it could be a hard question about MO : REPLY

$
0
0
I had heard of Jan Meeus, but I must admit that I thought he was much earlier than the 1920s. Certainly he did some good work on astronmical calculations. Have fun translating all those complex calcs to Bascom !

BASCOM-AVR : for the fist of january it could be a hard question about MO : REPLY

$
0
0
actually, MOD is supported for singles. you need to use single variables for the operands. the current version uses a different algo than excel/vba. if i remember correct, you will get various values for various MS basics from GW, QB, VB, to Excel. Josef has written the trig lib and we discussed the MOD in the past. Since excels/VBA algo is the most common one, i have changed the fpmod function to reflect this. It is simple to change : - open fp_trig.lib - remark the 2 calls to _fpround like ; rcall _FPRound ^remark - save and compile the lib using lib manager

BASCOM-AVR : submode=new + sub containing on : REPLY

$
0
0
Yes, I see your point now. But I still think that all those config-type statements should be handled by directly inserting them in your startup code. Then you know exactly where they are, and in what order they are processed. Sometimes that matters more than just code readability.

BASCOM-AVR : submode=new + sub containing on : REPLY

$
0
0
I had a look at it. While these config statements are intended to be used at the begin of the code, it should be no problem to use it like you do. The reason why it does not work is that at the time the used sub routines are inserted, the interrupt table is already created. I will change that since i consider this a bug.

BASCOM-AVR : for the fist of january it could be a hard question about MO : REPLY

$
0
0
Hi Mark, I just tried this in Bascom 2.0.7.7, but got an error 61, label not found [code:1:1683e4adc5] $regfile = "M328pdef.dat" $crystal = 16000000 Config Clockdiv = 1 $hwstack = 128 $swstack = 64 $framesize = 128 $baud = 19200 Config Submode = New Dim J As Single , B As Single Dim m as single J = 716.744 m = 360.0 B = j Mod m print b End [/code:1:1683e4adc5]

BASCOM-AVR : for the fist of january it could be a hard question about MO : REPLY

BASCOM-AVR : 2078 : REPLY

$
0
0
Mark, Thanks God !!! I was almost crazy to find what I have made wrong ... Ok, I will use others ways to make the same thing, this is very easy to make a "bypass". Thanks again, Mark and Duval, for your time and efforts ! Paulo

BASCOM-AVR : for the fist of january it could be a hard question about MO : REPLY

$
0
0
Confimed it works with version 2.0.7.8. Thanks Mark, that is a useful addition, especially with the rounding removed.

Share your working BASCOM-AVR code here : Fast library for SSD1289 LCD + Proteus Model : REPLY

$
0
0
Hello Mrshilov I like to say thank you for the good work you Put into writing the library routines I've tested the project it works Ok but. I tried to implement an sdcard from the. Atnega2560 project. And All my screen shows is a blank white screen I am using an atmega1284p running at 20Mhz could you please provide an easier library routine using An mmc. Sdcard because they are available everywhere you go spi roms are not available whre I reside thank you

BASCOM-ARDUINO : ILI9327 on Arduino Mega : NEWTOPIC

$
0
0
There is a sale going on, an Arduino Mega 2560 combined with an 400x240 ILI9327 TFT display... [img:cf295a3c00]http://members.home.nl/hobbycorner/images/Bascom_forum/overzicht.jpg[/img:cf295a3c00] [img:cf295a3c00]http://members.home.nl/hobbycorner/images/Bascom_forum/overzicht2.jpg[/img:cf295a3c00] with some small changes of the very nice code of AndersL I managed to get the display working. Have still to check the touchscreen however. [img:cf295a3c00]http://members.home.nl/hobbycorner/images/Bascom_forum/overzicht3.jpg[/img:cf295a3c00] Do a search for ili9327_final in this forum and change these lines in the ili9327_declarations.inc [code:1:cf295a3c00] Cs_disp Alias Portg.1 ' /Chip Select Display Config Cs_disp = Output Res_disp Alias Portg.0 ' /Reset Display für INIT Config Res_disp = Output ' ' Bl_disp Alias Portd.6 ' Backlight Display Not used here.Connected to VCC. ' Config Bl_disp = Output Rs_disp Alias Portd.7 ' Indexregister = 0, Data = 1 Config Rs_disp = Output ' Rd_disp Alias Portb.2 ' Read = 0, Write = 1 ' Config Rd_disp = Output Wr_disp Alias Portg.2 ' write data to Display 0 -> 1 = latch it Config Wr_disp = Output Data_disp_lo Alias PortC Config Data_disp_lo = Output ' Data to Display DB0-DB7 Data_disp_hi Alias PortA Config Data_disp_hi = Output ' Data to Display DB8-DB15 [/code:1:cf295a3c00] There is no seperate backlight on this display, it is allways on. Also, there is no RD_disp pin, so in the ili9327_functions.inc you will have to remove the RD_disp lines. It is a very sparkling display. Fast. About 7 euros if you buy it seperatly. Small note: the supplier is sometimes mixing up the delivery, got a 480x320 ILI9481 instead of this ILI9327 400x240 display. And also have bought ten of these displays, they are not very well packed, so got some with broken screens. The supplier has replaced these broken screens without any problems however. Have fun, and a happy New Year Ben Zijlstra

Share your working BASCOM-AVR code here : Fast library for SSD1289 LCD + Proteus Model : REPLY

$
0
0
SD-Card example is written by [i:da149dbadb]mr. Six1[/i:da149dbadb]. You can connect debugger to TXD pin to see what's wrong. [URL=http://radikal.ru/fp/3a1ad98606d748a09e0a44323e3a2aa0][img:da149dbadb]http://s011.radikal.ru/i318/1501/de/f9c7faf9dd0ct.jpg[/img:da149dbadb][/URL]

KokkeKat FAT-free SD card lib : Sdcreatefileordir problems.. : REPLY

$
0
0
Thanks for super quick response!! Sdreadfsinfo did the trick.. But, still have problems. Heres the program; . . gosub SDCardInit gosub writelog . . ************************************** SDcardInit: Gosub Sdinit if sdstatus=0 then 'SD OK. 'Check If Log file Exists. gosub Sdinitfs tmpstr=str(maned) tmpstr=format(tmpstr,"00") Sdentrynames = "LOG" + str(ar) + "02" + " TXT" Gosub Checkforfile if sdstatus<>37 then 'No file, Make it Sdcreatemode = 0 ' file, 1 = subdirectory Sdstartdirclusterd = 0 ' = the directory cluster number (in which the file or subdirectory should be created). Set to 0 for root directory. Sdyear = ar+2000 'the year Sdmonth = maned 'the month Sdday = dag 'the day Sdhours = timen 'the hours Sdminutes = minutt 'the minutes Sdseconds = sekund 'the seconds Sdcreatemode = 0 ' Create file Sdstartdirclusterd = 0 Gosub Sdreadfsinfo Gosub Sdcreatefileordir if SDstatus<>0 then Errors(2)=1 ErrorNames(2)="Createfile failed: " + str(sdstatus) Else Print "File Created ";Sdentrynames End if Else 'File Exists Print "File Exists ";Sdentrynames ENd if Else 'SDInit failed. Errors(1)=1 ErrorNames(1)="SDInit failed: " + str(sdstatus) End if Return WriteLog: ' INNstr="Hello World" GoSub Sdpreparetoappend While Sdclosefile = 0 And x<2000 ' Just a test Incr x tmpstr="A" Sdbyterw =asc(tmpstr) GoSub Sdwritebyte ' Save a byte to the card Wend print "Written ";x; " Bytes" 'Write Nl,Cr Sdbyterw =13 GoSub Sdwritebyte Sdbyterw =10 GoSub Sdwritebyte GoSub Sdfinalizeafterwriting ' After writing the last byte, close the file GoSub Sdwritefsinfo if sdstatus<>0 then errors(3)=1 errornames(3)="Failed to write "+str(sdstatus) End if Return I don't get any errors, but when trying the SD in PC, it will not read the file. After doing a disk repair, I get: Windows report. Wrong timeformat on file ... AND The file have not the correct size.. Now I can read the file, and everything looks OK. I have tried 10 times to reformat (Fat32) with same result. Running Win7 So still some bugs.. biting me. Any pesticide left?? Best regards svein ps. Tried with both buffered and unbuffered writing.. Ah.. And one more thing; In Your write example is this line; While Sdclosefile = 0 And Sdtempw2 < 1024 ' 512 times (always make sure that Sdclosefile = 0 before writing) Sdtempw2 < 1024 and '512 times???
Viewing all 20606 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>