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

BASCOM-ARDUINO : Arduino M2560-AVR port pin out : REPLY

$
0
0
many thanks to share your job, this picture is clear and easy to understand a special note about warning, very useful ! JP :wink:

BASCOM-AVR : a problem with the font in bascom : NEWTOPIC

$
0
0
hi i have a problem with the font in bascom.help me please. i uploaded problem picture. [/img]http://i57.tinypic.com/zlubly.jpg[img][/img] [b:501aa9b656][color=red:501aa9b656](BASCOM-AVR version : 1.11.9.0 , Latest : 2.0.7.7 )[/b:501aa9b656][/color:501aa9b656]

BASCOM-ARDUINO : getting started with Arduino and bascom : NEWTOPIC

$
0
0
here you will find step by step a protocol to start Waiting for comments JP :wink:

BASCOM-ARDUINO : Programm Arduino with Bascom - step by step solution : REPLY

$
0
0
hello, well you to , you lost your hair as me with arduino ? :lol: I'm still in W7 Windows version I hope it is ok with W8.1 In my last post I show a step by step method. I hope your hairdresser will be satisfied ! JP :wink:

BASCOM-AVR : double < 0 : REPLY

$
0
0
Hi, in my mind, you didn't understand, that in binary system you can not show all possible floatingpoint numbers. Read the help and think about. regards, michael

BASCOM-ARDUINO : NX-BRIDGE, an unique Arduino board with W5100 : NEWTOPIC

$
0
0
Hi there, time ago i wrote SOftware in Bascom for NX-Bridge. (MYSQL Access - Bascom) It is a M328 Arduino with SD-Card and Wiz5100 Chip on Board. Have a look at ElecFreaks: http://www.elecfreaks.com/wiki/index.php?title=NX_Bridge best regards, michael

BASCOM-AVR : I2C EEPROM read / write into a ST 24C256 : NEWTOPIC

$
0
0
My Testprogram for a I2C transfer in to a ST 24C256 EEPROM would not work as expected but I c'ant find the failure in the program Any help is very apreciated. Walter This is my samplecode: '===================================================================== ' I2C EEProm Test 2 ' ' 12.08.2014 / V 1 '===================================================================== $regfile = "m644pdef.dat" ' specify the used micro $crystal = 20000000 $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space $baud = 9600 Config Lcdbus = 4 Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.3 , Rs = Portb.2 Config Lcd = 20 * 4 Cursor Off 'LCD Cursor OFF '-------I2C config ------------------------------------------------------ 'Config Portd.2 = Input 'Interruptanschluss INT0 Config Scl = Portd.6 ' I2C Clock. Config Sda = Portd.7 ' I2C Data. $lib "I2C.LBX" Config I2cdelay = 10 ' I2C Taktfrequenz 100kHz '___________________________________________ ' ========================================== Dim X As Byte Dim A As Word Dim B As Word Dim Schreiben As Byte Dim Lesen As Byte Dim Adresse As Word At $160 'Die Adresse als Word-Variable Dim Low_adresse As Byte At $160 Overlay 'Zeiger auf das erste Byte Dim High_adresse As Byte At $161 Overlay 'Zeiger auf das zweite Byte '===================Hauptprogramm=============================================== Do '----schreiben---- For Adresse = 250 To 260 'Adresse geht über die Byte-Grenze Incr X '1 bis Überlauf I2cstart 'Start I2cwbyte &HA0 'Sende Slavadresse I2cwbyte High_adresse 'Sende Speicheradresse High I2cwbyte Low_adresse 'Sende Speicheradresse LOW I2cwbyte X 'Sende Wert I2cstop 'stop Waitms 10 Locate 1 , 1 Lcd "->Adres.=" ; Adresse ; "Wert=" ; X ; " " 'Anzeige vom schreiben Waitms 500 Next Adresse '---lesen---- For Adresse = 250 To 260 I2cstart 'Start I2cwbyte &HA0 'Sende Slavadresse +1 für Schreiben I2cwbyte High_adresse 'Sende Speicheradresse High I2cwbyte Low_adresse 'Sende Speicheradresse Low I2cstart 'Start I2cwbyte &HA1 'Sende Slavadresse +1 für Lesen I2crbyte Lesen , Nack 'Lese Adresse vom EEprom I2cstop 'Stop Locate 2 , 1 Lcd "<-Adres.=" ; Adresse ; "Wert=" ; Lesen ; " " 'Anzeige vom lesen Waitms 500 Next Adresse Loop End [b:c24030814f][color=red:c24030814f](BASCOM-AVR version : 2.0.7.7 )[/b:c24030814f][/color:c24030814f]

BASCOM-ARDUINO : Programm Arduino with Bascom - step by step solution : REPLY

$
0
0
I followed the step by step solution from JP Duval. As if by a miracle my Arduino worked fine with Bascom. Furthermore i took a saint smart uno and ... it works fine. Im happy. Thank you JP. Thank you, albertsm, for your fast answer. The Arduino works pretty with its software. Maybe yesterday i lost the overview about baud, comport, etc. What i realy lost is my hair like JP Duval supposed. To submit the evidence i attached a jpg file :D ___________ Best regards Stefan Schröter

BASCOM-ARDUINO : Arduino forum is living now ! : REPLY

$
0
0
Very nice, a Bascom Arduino corner.... Have fun Ben Zijlstra

BASCOM-AVR : double < 0 : REPLY

$
0
0
Michael. You don't understand my question about compare Double and Zero. Think about. Ivan.

BASCOM-ARDUINO : NX-BRIDGE, an unique Arduino board with W5100 : REPLY

$
0
0
michael, I remember, you help an other guy one time, some years ago about thermocouple Max Ic . I used you solution, I have never thanks you for that, It's time now ! many thanks for share your works ! jp :wink:

BASCOM-AVR : double < 0 : REPLY

$
0
0
ahh, ok... that can be the solution... i do not understand and therefore your code doesn't work... :lol: You ask about precision and have doubt about my skill? Maybe you better start debug and have a look for what exactliy going on in your mikro... best, michael

BASCOM-AVR : HHO Generator : NEWTOPIC

$
0
0
Hello everybody, I'm on on my HHO generator project, It's objective is to power a 5 Kw gas powered generator from an HHO cell. This will all be driven via an ATMEGA8-16 powered by Bascom. This will control the voltage and current to the HHO cell, fire the ignition coil and control the engine timing, control engine rpm and be controlled from the on board atmega8 or via a terminal program. I'm currently writing a program in xojo that will run in windows mac or linux, that will allow you to control it from a pc or cubieboard 1 or 2 I'm also going to port that code over to my Samsung cellphone running android, and control it from that later in the future. If enough are interested, I'll post up the project. Robert [b:bd999332b9][color=red:bd999332b9](BASCOM-AVR version : 2.0.7.7 )[/b:bd999332b9][/color:bd999332b9]

BASCOM-AVR : Question about programming : REPLY

$
0
0
Hello there, I currently use a boot loader in all of my projects, you can find a couple of projects I have uploaded here. I have since moved to a new type of IC that does not require any capacitors to run the serial port, it's of a surface mount type. Part# DS275S made by dallas. It works really well so far, and I will use it in all of my future projects as well... So if you look at the colloidal silver or shutter board project, both projects you can download the code and schematics for them. This way you can see how to use the max232 as this is what was used in them. (shutter board uses the dallas IC) For now I'm using a surface mount ATmega8 in most projects, you can just use the ICP programming pins if you have a programmer and you will need a programmer to get the boot loader onto the IC first, then you can program it over the serial port after that. If you should need further help, please feel free to post it up Robert

BASCOM-ARDUINO : Programm Arduino with Bascom - step by step solution : REPLY


BASCOM-AVR : I2C EEPROM read / write into a ST 24C256 : REPLY

$
0
0
have a look at the code from 24lcd515.bas which is in the samples folder. I include it below. it is for a bigger chip but will show that you must manipulate the address. [code:1:25405c4e38]$regfile = "m88def.dat" $lib "i2c_twi.lbx" $crystal = 8000000 $baud = 19200 Config Scl = Portc.5 Config Sda = Portc.4 'connect A0 and A1 to ground, A2 to VCC Declare Sub Writebyte515(address As Word , Value As Byte) Declare Function Readbyte515(address As Word) As Byte Dim B As Byte , Adrs As Word Dim Hdr As Byte , L As Byte , H As Byte , J As Byte Dim Choice As Byte , Wstart As Word Config Twi = 400000 I2cinit Print "24LC515 EEPROM DEMO" Do Input "0-write 10, 1-read 10, 2-read block ,3 clear" , Choice Select Case Choice Case 0 'write 10 bytes For Adrs = 0 To 15 B = Adrs Writebyte515 Adrs , B 'write value Next Case 1 'read 10 bytes For Adrs = 0 To 15 'read values back B = Readbyte515(adrs) Print B 'and show them Next Case 2 'read dump Inputhex "Start $" , Wstart Hdr = &B10100000 Hdr.3 = Wstart.15 ' A15 address bit H = High(wstart) L = Low(wstart) I2cstart I2cwbyte Hdr I2cwbyte H I2cwbyte L I2crepstart 'repeated start Hdr.0 = 1 ' we will read now I2cwbyte Hdr For J = 1 To 63 I2crbyte B , Ack 'read byte Print Hex(b) ; ","; Next I2crbyte B , Nack 'read byte Print Hex(b) I2cstop Case 3 For Adrs = 0 To 15 B = &HFF Writebyte515 Adrs , B 'write value Next End Select Loop End 'write a byte to the 24LC515 memory Sub Writebyte515(address As Word , Value As Byte) Hdr = &B10100000 Hdr.3 = Address.15 ' A15 address bit H = High(address) L = Low(address) I2cstart I2cwbyte Hdr 'address with A15 segment bit I2cwbyte H 'MSB I2cwbyte L 'LSB I2cwbyte Value I2cstop Waitms 10 End Sub 'read a byte from the 24LC515 memory Function Readbyte515(address As Word) As Byte Hdr = &B10100000 Hdr.3 = Address.15 ' A15 address bit H = High(address) L = Low(address) I2cstart I2cwbyte Hdr I2cwbyte H I2cwbyte L I2crepstart 'repeated start Hdr.0 = 1 ' we will read now I2cwbyte Hdr I2crbyte Readbyte515 , Nack 'read byte I2cstop End Function [/code:1:25405c4e38]

BASCOM-ARDUINO : Arduino forum is living now ! : REPLY

$
0
0
hi Jean-Pierre, thanks for your contribution. A good idea to create a dedicated forum. with all the different hardware and loaders it can be hard to get things going.

BASCOM-AVR : CONFIG SUBMODE = NEW Problem and Question : NEWTOPIC

$
0
0
Hello All, I am breaking apart a working program into a new program that should come out the same, but will utilize includes. All Declare Subs are remarked. Many subs have been moved out of the main .bas file, but there remains some. My problem is, the compiler complains that the sub or function cannot be found. When using CONFIG SUBMODE = NEW, do ALL subs have to be outside the .bas file? At the start of the program I have [code:1:7001b840cf] $regfile = "m168pdef.dat" $hwstack = 256 '128 '32 $swstack = 256 '128 '20 '10 $framesize = 160 '144 '128 '96 '40 $crystal = 8000000 '8MHz (internal RC) $baud = 9600 $noramclear Debug Off 'Off CONFIG SUBMODE = NEW [/code:1:7001b840cf] Again, all Declare Subs are remarked. The compiler complains about ones that remain in the .bas file. [code:1:7001b840cf] Call Update_Ack_Int [/code:1:7001b840cf] The compiler also complains about another sub, also in the main .bas file. [code:1:7001b840cf] Call Assemblenibble(1) [/code:1:7001b840cf] These are at the end of the .bas file. [code:1:7001b840cf] '********************************************************************************************** '********************************************************************************************** Sub Assemblenibble(byval Cnt As Byte) Txbuffer(8) = Device_type Or Cnt End Sub '********************************************************************************************** '********************************************************************************************** Sub Update_Ack_Int 'ACK Interval managed by Random Number Generator _rseed = Address + 100 '_rseed = Address Do Ack_interval = RND(3100) ' Rnd(253) '65535 Loop Until Ack_Interval > 270 End Sub [/code:1:7001b840cf] Also, is there anything "wrong" with using "Return" at the end of a Sub, or within a Sub? This is a habit from another IDE. Thanks all, Tim [b:7001b840cf][color=red:7001b840cf](BASCOM-AVR version : 2.0.7.7 )[/b:7001b840cf][/color:7001b840cf]

BASCOM-AVR : CONFIG SUBMODE = NEW Problem and Question : REPLY

$
0
0
you really should read the help. [b:f7520fede1]When you use CONFIG SUBMODE=NEW, most behaviour is changed : - there is no need to DECLARE a sub/function before you call it. But, the actual sub/function code must be placed before the actual call! [/b:f7520fede1] this means that you either need to use some $include or when you leave the sub in the main program, you need to have the code before the actuall call : sub test() end sub test ' call test 'same as test in this sample it is correct since the sub implementation is before the actuall call. if you do call the sub/function without a DECLARE or without the code preceding it, the compiler does not know the sub/function. RETURN : a bad idea. it can be done when you do not pass parameters. only use return when there is a matching label that is called like : sub test() print "test" gosub abc exit sub abc: print "abc" return End Sub

BASCOM-AVR : CONFIG SUBMODE = NEW Problem and Question : REPLY

$
0
0
Hello Mark and thank you for your reply. [quote:0b161438d9] you really should read the help. [/quote:0b161438d9] I did sir. [quote:0b161438d9] When you use CONFIG SUBMODE=NEW, most behaviour is changed : - there is no need to DECLARE a sub/function before you call it. [/quote:0b161438d9] The old Declares were remarked. [quote:0b161438d9] But, the actual sub/function code must be placed before the actual call! [/quote:0b161438d9] OK. This explains it. So really, when using CONFIG SUBMODE=NEW, it is best to have all subs in a .inc file with the $Include statement at the top. That would virtually put them all before any calls are made. Makes sense since the old way required Declare Sub to be before any calling - just a little counter intuitive since it appeared that the Config statement somehow allowed no difference to where the Subs are located; by virtue of the compiler finding them first with the $Include at the top, the same requirement is met. Thanks again for the reply, Tim [/quote]
Viewing all 21191 articles
Browse latest View live