Main Menu
Counter
This page today ...
total: 0
unique: 0

This page ever ...
total: 202
unique: 133

Site ...
total: 3047
unique: 1502
Online
  • Guests: 1
  • Members: 0
  • Newest Member: ole
  • Most ever online: 47
    Guests: 47, Members: 0 on Wednesday 21 February 2018 - 23:52:15
Chatbox
You must be logged in to post comments on this site - please either log in from the Login box or from here.If you are not registered click here to signup.


bullet Kim
1 year ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR : Recept nul char / Bascom : REPLY



    Hi Bernard,
    Thats greate news.
    Im on my way home I will try to tweak the code little bit, when I get time.
    Im open suggestions.

  • BASCOM-AVR : Recept nul char / Bascom : REPLY



    Hello Pikczu
    everything works almost normally except for some ACK / NAK management details.
    The main problems were:
    -Allimentation of the LCD
    -Share of COM1 with USB arduino card
    - In the Do / Ischarwaiting / Loop function, do not put any other functions.
    I thank you very much for your help!
    Bernard :roll: :roll: :smt024

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    as I implied before.

    b=a+a
    a=a-b
    no multiplication

    a*2 with binary it can also be done with shift to make it fast.

    ……….a - a=0!

    regards
    Hubert

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    and my 16 cycles solution, but readable for beginners :idea:

    [code:1:e30fea3027]
    Dim Number As Single
    Number = 123
    Print Number
    toggle Number.31
    Print Number
    [/code:1:e30fea3027]

    Have all a nice weekend
    cheesey

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    [quote:edee31e49f="theo64"]which i think is the same as i suggested.. a = -a[/quote:edee31e49f]
    Interestingly you think wrong. At least in terms of execution cycles.

    [quote:edee31e49f="Netzman"]Possibly the fastest method:

    [code:1:edee31e49f]Dim Number As Single
    Dim Upperbyte As Byte At Number + 3 Overlay
    Const Signreverse = &H80

    Number = 1
    Upperbyte = Upperbyte Xor Signreverse ' 8 cycles
    Print Number[/code:1:edee31e49f]

    Takes 8 cycles.
    [i:edee31e49f]0 - s[/i:edee31e49f] takes 202, [i:edee31e49f]-s[/i:edee31e49f] and [i:edee31e49f]-1 * s[/i:edee31e49f] each complete in 279 cycles.[/quote:edee31e49f]
    Do you truly believe your botchery is useful for an user who does not even know the most simple thing of inverting the sign of a variable?
    Btw., you're not the only one knowing about the sign-bit, however your code looks bulky and has no ease of use of an a = -a.
    As you're a clever guy, do some graphs showing cycle savings vs. ugliness of code. cheesey

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    Possibly the fastest method:

    [code:1:58cb4be997]Dim Number As Single
    Dim Upperbyte As Byte At Number + 3 Overlay
    Const Signreverse = &H80

    Number = 1
    Upperbyte = Upperbyte Xor Signreverse ' 8 cycles
    Print Number[/code:1:58cb4be997]

    Takes 8 cycles.
    [i:58cb4be997]0 - s[/i:58cb4be997] takes 202, [i:58cb4be997]-s[/i:58cb4be997] and [i:58cb4be997]-1 * s[/i:58cb4be997] each complete in 279 cycles.

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    which i think is the same as i suggested.. a = -a

  • BASCOM-AVR : KS108 128x64 do not Initialize : REPLY



    NT7108C are similar with Samsung KS0108B

    search forum for KS0108 lots of sample code that worked

    [code:1:1d2223fe16]$include "Font8x8.font"
    $lib "glcdKS108.lbx"

    'for Glcd Ks108
    'First we define that we use a graphic LCD
    Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 2 , Rd = 3 , Reset = 5 , Enable = 4 , Mode = 6

    'The dataport is the portname that is connected to the data lines of the LCD
    'The controlport is the portname which pins are used to control the lcd
    'CE = CS1 Chip select
    'CE2 = CS2 Chip select second chip
    'CD = DI Data/instruction
    'RD = R/W Read/Write
    'RESET = RST reset
    'ENABLE = E Chip Enable
    'And Potmeter for contrast to +5V, V0, VEE (V0 is center pin on pot)

    Setfont Font8x8

    Dim Char As Byte , L As Byte , C As Byte
    'Show lcd ascii on lcd
    Do

    Cls
    Char = 31
    For L = 1 To 8
    For C = 0 To 127 Step 8
    Char = Char + 1
    Lcdat L , C , Chr(char)
    Next C
    Next L

    Wait 2

    Cls
    Char = 128
    For L = 1 To 8
    For C = 0 To 127 Step 8
    Char = Char + 1
    Lcdat L , C , Chr(char)
    Next C
    Next L

    Wait 2

    Loop

    End [/code:1:1d2223fe16]

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    [quote:0189d22629="six1"][code:1:0189d22629]s=s * -1[/code:1:0189d22629][/quote:0189d22629]
    As a basic rule multiplications and divisions should be avoided, where additions and subtractions are usable, as the latter are faster:
    [code:1:0189d22629]s= 0 - s[/code:1:0189d22629]
    Not much gain in this case, 'only' 28 percent faster.
    Where speed is required, 28 percent is really something.

  • BASCOM-AVR : Sign reversal on Single variable? : REPLY



    A very simple way would be:

    a=a-(2a)

    regards
    Hubert

| Date published: not known
Back to newsfeed list
Welcome
Username or Email:

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR : Recept nul char / Bascom : REPLY
Hi Bernard, Thats greate news. Im on my way home I will try to tweak the code little bit, when I get time. Im open suggestions...
»BASCOM-AVR : Recept nul char / Bascom : REPLY
Hello Pikczu everything works almost normally except for some ACK / NAK management details. The main problems were: -Allimentat...
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
as I implied before. b=a+a a=a-b no multiplication a*2 with binary it can also be done with shift to make it fast. ………....
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
and my 16 cycles solution, but readable for beginners :idea: [code:1:e30fea3027] Dim Number As Single Number = 123 Print Nu...
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
[quote:edee31e49f="theo64"]which i think is the same as i suggested.. a = -a[/quote:edee31e49f] Interestingly you think wrong. At...
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
Possibly the fastest method: [code:1:58cb4be997]Dim Number As Single Dim Upperbyte As Byte At Number + 3 Overlay Const Signre...
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
which i think is the same as i suggested.. a = -a
»BASCOM-AVR : KS108 128x64 do not Initialize : REPLY
NT7108C are similar with Samsung KS0108B search forum for KS0108 lots of sample code that worked [code:1:1d2223fe16]$incl...
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
[quote:0189d22629="six1"][code:1:0189d22629]s=s * -1[/code:1:0189d22629][/quote:0189d22629] As a basic rule multiplications and d...
»BASCOM-AVR : Sign reversal on Single variable? : REPLY
A very simple way would be: a=a-(2a) regards Hubert


Date published: not known
Details

»Pin mehrfach verwenden
Hallo zusammen, ich habe da ein kleines schaltungstechnisches Problem, wo ich als Elektronik-Laie nicht so richtig weiterkomme. Mir fehlt an einem ...
»ssd1306 mit dma
hat jemand schon mal versucht die $lib "glcdSSD1306-I2C.lib" so umzubauen, dass sie mit dma funktioniert, um zeit zu sparen?
»DCF77 + Timer2 Asynchron
Hallo! Vor einigen Jahren wunderte ich mich schon, kann mich aber gerade nicht erinnern ob ich damals eine Lösung fand: Ich brauche auf einem ATm...
»mehrdimensionales array als overlay von einem eindimensionalen, wie ist die Anordnung?
Wenn ich ein array (100) as byte habe, werden die bytes nacheinander, beginnend mit byte1 im Speicher angelegt. Wenn ich als overlay ein array1(2,5...
»Variablen können nicht ins Eeprom gespeichert werden
Hallo, bisher hatte ich immer mit Readeeprom und Writeeeprom gearbeitet. Nun nutze ich die Eram Variablen. BASCOM-Quellcode (29 Zeilen) Es sollen...
»Bluetooth-Modul HC-05: Pairing
Hallo zusammen! Hat hier vielleicht jemand Erfahrung mit den Bluetooth-Modulen HC-05? Ich habe Probleme beim Pairing und komme irgendwie nicht wei...


Date published: Mon, 25 Mar 2019 19:24:18 +0000
Details

»93c46 editor programmer bascom & vb93c46 editor programmer bascom & vb
»93c46 Bascom & VB693c46 Bascom & VB6
»Analog clock on SSD1289 3.2" 240x320 lcdAnalog clock on SSD1289 3.2" 240x320 lcd
»Nextion HMI lcd with KaraDio the best webradio esp8266Nextion HMI lcd with KaraDio the best webradio esp8266
»Adding 240x320 lcd to the WifiWebRadioAdding 240x320 lcd to the WifiWebRadio
»IV-17 Nixie clock GPS set time & date at power onIV-17 Nixie clock GPS set time & date at power on


Date published: not known
Details

»Bascom Can Bus Sniffer
»R.I.P Ben Zijlstra
Remembering Ben Zijlstra We hope that people who love Ben will remember and celebrate his life. more info at MCS www.mcselec.com/index2.ph...
»KaRadio webradio ESP8266
The Dimitris board is available at https://github.com/dsaltas/WiFi-WebRadio  This is a hardware project for Ka-Radio
»93C46
small tool to edit 93C46 eeprom written in BascomAVR & VB  Bascom control the 93C46 so we sent data via comport from VB code will be added later ...
»nRF24L01+ RC Controller
This is a RC controller TX & RX unit with nRF24L01+ nRF24L01+ / with PA and LNA for longer range facts: TX 1 x potmeter for servo ...
»RAW lcd
Connecting RAW lcd to atmega8 the lcd is 6 digit + time glass LCD Hour Meter for  tractor ,air compressor, ect the lcd have 4 com pins  & 14...


Date published: not known
Details


Proudly powered by e107 which is released under the terms of the GNU GPL License.