1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

A freeware virtual breadboard

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by William At MyBlueRoom, Aug 28, 2006.

  1. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    I mostly prefer free sofware (as in open source) anyway.
     
  2. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia

    Just a reminder On that restriction, that’s 50 lines of Proton code, Not the .ASM Or .HEX it compiles it down too And it excludes REMARKS and labels, there’s a damn lot you can do with 50 lines in Proton(it may compile To any number of lines)


    Code (text):
    Device = 16F877A
    XTAL = 4
    ALL_DIGITAL = False
    PORTB_PULLUPS = True

    LCD_DTPIN = PORTB.4
    LCD_RSPIN = PORTB.2
    LCD_ENPIN = PORTB.3
    LCD_INTERFACE = 4           ' Setup the LCD
    LCD_LINES = 2
    LCD_TYPE = 0

    Declare SCL_PIN PORTC.0
    Declare SDA_PIN PORTC.1

    Dim Result As Float        ' Create a register accurate from  -2147483646.999 to +2147483646.999
    Dim Sign As Byte
    Dim Cnt As Byte
    Dim Count_Per_Deg As Byte
    Dim Temp As Word
    Dim Temp_Dec As Byte
    Symbol DQ=PORTD.1       'Place the DS1820 on bit 1 of PORTD
       
       DelayMS 150
       Cls
       
       Print At 2, 1, "Power is On"
       
       TRISA = %11111111           
       ADCON1 = %10000000

    Main:

        Result = ADIn 0

        EWrite 00, Result
       
        Print At 1,1, DEC2 Result * 5 / 1023, "V"
     
        BStart                               ' Send the start command on I2C
        BusOut %10100010,$00,[Result]        ' Send the byte to the eeprom
        BStop                                ' Send the stop command on I2C


        OWrite DQ, 1,[$55,$10,$92,$1F,$05,$01,$08,$00,$6B,$44] 'Send calculate temperature command
                  ' FF  I1  I2  I3  I4  I5  I6 CRC     ' FF - Family, Ix - Address byte, CRC - checksum
        Repeat
          DelayMS 25 'Wait until conversion is compleate
          ORead DQ,4,[Cnt] 'Keep reading low puses until
        Until Cnt <> 0 'the DS1820 is finished

        OWrite DQ,1,[$55,$10,$92,$1F,$05,$01,$08,$00,$6B,$BE] 'Send read scratcpad command
                  ' FF  I1  I2  I3  I4  I5  I6 CRC     ' FF - Family, Ix - Address byte, CRC - checksum
        ORead DQ,2,[Temp.LowByte,Temp.HighByte,Cnt,Cnt,Cnt,Cnt,Cnt,Count_Per_Deg]

        Temp_Dec = (6.25 * Cnt)              ' Each Cnt is 1/16 of a degree, therefor 100/16 = 6.25, and thats our decimal value

        If Temp.8=1 Then                     ' Bits 8-15 are 1 for a negative temperature and 0 for a positive
            Temp=(Temp.LowByte ^ $FF) >> 1   ' If negative then drop the first bit, and invert the value
            If Cnt = 0 Then Temp = Temp + 1  ' If Cnt = 0 then increment Temp, as the 1820 does not do this
            Sign = "-"                       ' Change the sign to a negative
        Else
           Temp=(Temp >> 1)                  ' If positive then drop the first byte
            Temp_Dec = 100 - Temp_Dec  
            Sign = "+"                       ' And change the sign value to positive
        EndIf

        Print At 1,6, Sign, Dec2 Temp, ".", Dec1 Dig Temp_Dec, 1, " DegC  "
       
        GoTo Main
       
       
       

    The program above is;
    - Taking an ADC sample from porta.0
    - Storing it in the PICs EEPROM
    - Displaying it on a LCD
    - Sending it via I2C to an external EEPROM to store
    - Requesting data from a DS18S20 using Dallas 1 Wire
    - Receiving the 1 Wire data
    - Displaying the current temperature on the LCD
    - Performing all of the above in a continual loop

    Some of the remarks are jaggerd, but im sure you get the jist
     
    Last edited: Jan 4, 2007
  3. mramos1

    mramos1 Active Member

    Joined:
    Sep 15, 2005
    Messages:
    2,403
    Likes:
    9
    Location:
    Boynton Beach, Florida USA
    One day I will go dig up the simple program. They might have a bug as I did not have a lot of lines of code (will count them when I dig it up; right) and my task was different than yours in your upload, mine was very simple (all digital IO and maybe ADC on one pin).

    But if I can not download and install and write a simple program. Something is not right. MikroBASIC does all that for me for simple projects. OK for all of them so far.

    After removing a line or two in Proton to add one, over and over. I gave up.

    But a very small program that it did compile with Proton, the code was tight, that is why I focus on them.

    If I need to buy other peoples stuff in the price, I guess I am still out. That is not right.. I will not by a PC that has to come loaded with Windows unless I need Windows.

    Do you work for them or have buddies there and just really like the product that much??

    Why do I need something a company thinks I need.

    If I make Unix machines I do not need Windows. If I want a BASIC compiler, I to not need Proteus/Simulator.

    And your comments on .ASM. I get it. I will use the demo and write the subs in .ASM format since they do not count in the 50 lines. And some of the main in .ASM format to save lines.

    For you non-basic people you can type .asm and write in assembler in most of these SO CALLED Basic compilers. Proton is good but you have to buy a simulator that adds a lot to the price. I do not need that part.

    So it looks like I need MPLABS at this point if I use the .ASM. so much (Nigel is laughing again). And need to find someone that will share some good macros.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia

    imho using asm is like using dos - there’s no need to "re-invent' the wheel when you can accurately and efficiently, yes proton is very efficient, use a higher level development suit. Would you ditch Visual Basic/C++ and start writing in assembler/hex on your PC?

    I really wish I did!! But no. I'm just trying to share with as many people as I can about how great the development tool is.

    Its just one of the perks of buying proton+, it’s a tool - a great tool, but to buy the full version is a lot of coin. With Proteus you can throw in hundreds of digital/analogue components simulate & debug the circuit in minutes, once again, its about where your at, try it, buy it, or just not even use it at all – your choice.

    Wont work. You misinterpreted me. Proton may compile the basic file to 200 lines in .ASM - then it compiles it to .HEX - its 50 Proton+ Lines(without remarks/labels)

    Negative. Protues is NOT a full version with the Proton+ development suit - you are paying for a leading edge PIC programming development suit, not the license of Protues. Its more of a 'basic debugger' in its PDS release, and allows you to only interface with certain components, still extremely useful! I used to use the virtual terminal & lcd components to debug program all the time before putting them into real life apps.

    I completely respect Nigel's passion for assembly; I too used to be there. But ASM is not for everyone, and with the growing diversity of PIC micros, and other products on the market (GSM/GPS/XBEE/heaps), there is a growing need for higher level programming
     
  6. mramos1

    mramos1 Active Member

    Joined:
    Sep 15, 2005
    Messages:
    2,403
    Likes:
    9
    Location:
    Boynton Beach, Florida USA
    gramo:

    I personally use PowerBASIC and x86 ASM. So I would not ditch either. But on a Windows machine, PowerBASIC makes life very simple.

    As for a PIC with say 35 instructions. It is really not all that bad.

    I will stick to my way as it works. But look harder at ASM. Maybe like the old days, write it in BASIC lines with ; in front each line and drop the ASM between.

    Almost $300 for a BASIC compiler, I thought PowerBASICs price was high. :)
     
    Last edited: Jan 5, 2007
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,233
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Hi panadol,

    I would recommend that you take a look at www.oshonsoft.com, they have a
    pic simulator program, which covers a wide range of pics. The program includes
    a basic compiler which creates a commented assembly listing, as well as the usual
    hex file. The assembler file can be directly ported to the MPLAB IDE program if
    required and is ideal for anyone learning assembler coding.
    Although the pic sim dosn't run at a blinding speed, there are user
    options for internal timings which can be customised. The user program can also
    be stepped for each instruction, ideal for debugging routines.
    The pic sim has a number of modules that can be run from a program under
    development in the pic sim, lcd, uart, switches and leds etc.
    A template is available so that the user can write his own modules for the sim.

    Visit www.manorts.co/phpBB site where you will find a number of simulator
    modules written by pic sim users.

    The pic sim is not free, but is a try and buy.

    Let me know what you think.

    Regards
    EricG
     

Share This Page