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

BASCOM-AVR : Local Variables : REPLY

$
0
0
[quote:67294114d5="njepsen"]I seemed to remember from somewhere a note that locals must be written "before" executable code.[/quote:67294114d5] If this is the case and if the compiler's behavior should not be altered, then a warning in the help either at "local" or "exit sub" is recommendable. [quote:67294114d5]The hour between crashes didnt help.[/quote:67294114d5] If the "clockwork" of the Y-pointer runs out of step, weird things may happen. The time between crashes depends on how often this sub is called, as every time it's called, the Y-pointer comes closer to the other stacks, soft and hard. If they meet, data corruption or a crash will happen.

BASCOM-AVR : Local Variables : REPLY

$
0
0
You are absolutely correct Ludwig. The sub was only called every 5 seconds so it took about an hour to fail; i wrote a test loop that called it every 100ms, and it failed in very quick time, and at exactly the same number of interations, which was the clue I needed. If you write code like this: [code:1:c05f670688] sub anyname() if something then local variable name as byte blah blah end if end sub [/code:1:c05f670688] the compiler will tell you the local is in the wrong place and must be "before any executable code" , but it seems it doesnt know about exit sub. cheers

BASCOM-AVR : Local Variables : REPLY

$
0
0
Have to try and keep this in mind! Maybe something that may change in the totally new version that mark is writing Look forward to it being released and even happy to pay for it. All that work should get paid for!! Regards Paul

BASCOM-AVR : HX711 ADC 24 bits : REPLY

$
0
0
Also instead Long use Dword because in C code used unsigned long(Bascom doesn't has unsigned) so Dword is 32 bit unsigned variable as unsigned long in C Regards.

BASCOM-AVR : HX711 ADC 24 bits : REPLY

$
0
0
Hi Evert, Yes, your suggestion correctly, I had to type Pind.5 not Portd.5 Why I always forget about Portx.y for output bit assignment and Pinx.y for input bit assignment :roll: Thank you very much for the correction. Hi Dibor, I look at Bascom AVR Help, there is no Dword, but when I try to compile the result is successful, I just realize that Dword actually already supported. And currently I am still using 24-bits only for this purpose. Thank you for the very useful information.

BASCOM-AVR : ollopa's swusb and timers : REPLY

$
0
0
That's a little bit the disadvantage of software usb stack, it consumes a lot of resources. You can try a hardware usb avr with the [url=http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=173&category_id=6&option=com_phpshop&Itemid=1]Bascom USb Addon[/url]. Did numerous projects with it, no problems at all so far.

BASCOM-AVR : FT800 : REPLY

$
0
0
:smt038 FT800 seems to be a very good product, typicaly English ! clever as Vinculum. Is your lib works also with audio file ? I saw also : $NOTYPECHECK and nothing in the help file about, But may be my view is not so accurate ? Again bravo ! JP :wink:

BASCOM-AVR : FT800 : REPLY

$
0
0
JP Audio files need to be converted to a Raw type of file before played (FTDI has utilities for this). $NOTYPECHECK will stop the compiler complaining when assigning values to different variables types. things like word to byte etc.. (Mark will explain more).

BASCOM-AVR : Atemu / AT_emulator.lib : NEWTOPIC

$
0
0
Hi, i bought the PS2 emulator Library a while ago and sucessfully developed some Keyboard devices with it (using USB/PS2 converters). I now want to use the Keyboard Status LEDs but i cant find any information if or how they are implemented. Is it possible to use the status LEDs (Nun, cab,roll)? Regards, Tobi [b:1d06f8192d][color=red:1d06f8192d](BASCOM-AVR version : 2.0.7.7 )[/b:1d06f8192d][/color:1d06f8192d]

BASCOM-AVR : INPUT command : NEWTOPIC

$
0
0
Well I didn't think I would be asking this but I have now spent ages trying to sort this. here is the code [code:1:97695be254] dim command as string * 3 OPEN "com1:" for binary as #1 do input #1,command select case command case "AAA": call flashled1(100) case "BBB" call flashled1(100) waitms 200 call flashled1(100) waitms 200 end select loop [/code:1:97695be254] This works first time I enter AAA or BBB then no matter what I put in it does not work I have tried extending string size, this did not even flash at all! I have tried taking first 3 chars into another string using LEFT I have tried using just INPUT without open and the channel numbe Please help it's driving me MAD! Steve P.S. no watchdogs or interrupts running [b:97695be254][color=red:97695be254](BASCOM-AVR version : 2.0.7.7 )[/b:97695be254][/color:97695be254]

BASCOM-AVR : INPUT command : REPLY

$
0
0
Likely your terminal program sends a CR/LF, while Bascom's Input is configured by default to accept a CR. Thus the LF didn't get "eaten up" and is left in your string, thus following compares will fail. Use Config Input to set the Input function accordingly your terminal program, or change the terminal program's behavior.

BASCOM-AVR : INPUT command : REPLY

$
0
0
Hello Scarr Using Input to get commands from a serial line eg like a command line on a terminal, is not the best way to do it. If you are trying to use a PC or like device to control the AVR have a look at the Blog section and my web servers they have a command line interface working on them they are modular so you can take just the file that is the command line and use it. Also I have written a program for a clock that watches for a particular byte in the data then decodes the time from that data using Bytematch you can see the code here http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=9950&highlight=bytematch Note it also good to let people know what you are trying to acheive with your code then they can send you in the right direction. Regards Paul

BASCOM-AVR : INPUT command : REPLY

$
0
0
[code:1:d8957895d1] dim command as string * 3 [/code:1:d8957895d1] That's to short defined, increase it to 6

PCB's : I can highly recommend this PCB Manufacturer : NEWTOPIC

$
0
0
Yesterday I got my first PCB's. Quick, cheap and really good quality. 10pcs 5x5 cm, hasl, silk and soldermask on both sides for US$ 9,90. http://www.seeedstudio.com/service/index.php?r=pcb Regards Michael

BASCOM-AVR : INPUT command : REPLY

$
0
0
[quote:11a00121a7="Evert :-)"][code:1:11a00121a7] dim command as string * 3 [/code:1:11a00121a7] That's to short defined, increase it to 6[/quote:11a00121a7] If things work correctly, means same input terminators for transmitting and receiving end, a string dimensioned for 3 chars is enough for an input of 3 chars plus terminators CR/LF, as the CR/LF doesn't make it into the string. If things go wrong, like in this case, looping the second time, the first char of the string is a LF, which is left in the UART, followed by two input chars, like "AA". The following compare fails, but nothing more happens, the Input command does not take more chars, than the string can hold. In contrary, if the string would hold 6 chars, and terminators are mismatching, the string content would look like: "<LF>AAA" A compare for "AAA" would still fail, so nothing is gained. That's why I disagree, the string isn't defined too short, it is just right with 3 chars length.

BASCOM-AVR : INPUT command : REPLY

$
0
0
I use this code to control one of my devices. Thre digit string are send from PC programm but then Always VBcr command are send with that string, because Input can froze Your program without it. If I use Terminal and type a one char for example then AVR hold and wait for Enter.. so if any trash step behind "Ifchariswaiting" then better somme times send empty CR command. [code:1:09648585a0]Dim Y As String * 3 If Ischarwaiting() = 1 Then Input Y Z = Val(y) Select Case Z Case 0 To 255 X = Z Case 300 Tryb = 0 Status = Chlodzenie_start X = 0 Old_odczyt = 0 Case 301 Tryb = 1 Status = Tryb_reczny Case 600 To 700 Hist = Z - 600 Writeeeprom Hist , 4 Case 800 To 900 Pilnuj = Z - 800 Old_odczyt = 0 Writeeeprom Pilnuj , 2 Case 900 Set Aux1 Set Aux2 Case 901 Reset Aux1 Set Aux2 Case 910 Set Aux1 Reset Aux2 Case 911 Reset Aux1 Reset Aux2 Case 999 Start Watchdog 'this for Bootloader End Select End If [/code:1:09648585a0] this solution is my first and I don`t use it anymore.

Various : building a vga card 800X600 24 BITS COLOR : NEWTOPIC

$
0
0
HELLO i will try to do a vga controller with atmega 128 and some memories ,there is lots lcd vga monitor cheaper. 1)the board will be able to manage a vga screen for photo and graphic for plot curves. at least 800X600 full color perhaps 1024X768 POSSIBLE ? 2)it will be abble to manage a sd card of 2gb , for storage and for recoed or play sounds according to several events. with a pwm amplifier 3) may be include a ethernet controller 4) a wifi or bluetooth wireless connection 5) i dont know , but all idee are well come 1) i think i can do it for manage the display (signals synchronisation ) . may be i will need help on decoding bmp giff or jpeg 2) i plan to use kokkecat fat that work well on atmega 8 for manage the sd card , play and record 3) ethernet controler ENC28J60. cheaper ? or other ? but i don t have any experience on web server 4) help may be requested for , also . 5) all idee are welcome thank you for you comments :D

Various : building a vga card 800X600 24 BITS COLOR : REPLY

$
0
0
Hello Benoit Sounds interesting he M1284 may be usefull for this with its 20Mhz and 16K of ram Regards Paul

Various : building a vga card 800X600 24 BITS COLOR : REPLY

$
0
0
no enc28j60 but a W5100 ethernet controller. My two cents... Ben Zijlstra

Various : building a vga card 800X600 24 BITS COLOR : REPLY

$
0
0
HELLO PAULVK i plan to use xmega128A1 OVERCLOCKED MAY BE, will see it look like the one you describe HELLO BEN'S THIS CHIP COST 8 EURO it should be ok the target price of the project must be around low coss as possible :P
Viewing all 20563 articles
Browse latest View live


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