Shop OBEX P1 Docs P2 Docs Learn Events
Download PropBASIC here... 00.01.14 LAST VERSION FOR BST - Page 18 — Parallax Forums

Download PropBASIC here... 00.01.14 LAST VERSION FOR BST

1151618202129

Comments

  • train nuttrain nut Posts: 70
    edited 2010-05-26 12:55
    Bean

    When are you going to update demos.zip to reflect the change in GETADDR command?

    Ben
  • BeanBean Posts: 8,129
    edited 2010-05-26 13:46
    Ben,
    I just uploaded a new demos.zip file this morning.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • Tony B.Tony B. Posts: 356
    edited 2010-05-26 15:30
    Some more info about about error problem thought to be related to file name. Files that wouldn't compile I been able to make compile by:

    1. Saving the pbas file in another new directory that didn't contain the generated Spin file on compiler error.

    2. The second file I got to work showed the same errors as the screenshot above, but the real error was I had a missing ENDIF. The error message never showed that.

    I don't know if these items would be considered bugs or not. Also, any thoughts on why saving pbas files to new directory allows the files to compile and not in the old directory? I even tried erasing the Spin files generated by failed compile and that didn't help.

    Thanks,
    Tony
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-26 20:52
    Bean,

    Thanks.· I tried the code that you suggested and it did not work.

    Here is what I tried:
    ' Reads the temperature from a Dallas DS18B20
    ' Converts it to ascii and sends it to the PC
    ' Connect DS18B20 DQ pin to PIN 1 on the propeller
    ' Don't forget the 4.7K pullup resistor too...
    '
    
     
    DEVICE P8X32A, XTAL1, PLL16X
    FREQ 80_000_000
     
    ' Define CONs
    
     
    Baud     CON "T115200"
     
    ' Define PINs
    
     
    DQPin    PIN 16 INPUT   ' 1-Wire communication pin to DS18B20
    TX       PIN 30 HIGH   ' Send data back to PC
     
    ID1 DATA 10, $55,$46,$00,$00,$02,$7C,$B1,$D5,$28,$44 ' Number of bytes, data bytes
    ID2 DATA 10, $55,$46,$00,$00,$02,$7C,$B1,$D5,$28,$BE ' Number of bytes, data bytes
     
    value VAR LONG
     
    SendID SUB 1 ' Parameter is a DATA label
     
    '--------------------------------------------------------
    ' Jon McPhalen's TX formatting SUBs.
    '--------------------------------------------------------
    '
    ' [url=http://forums.parallax.com/showthread.php?p=907567]http://forums.parallax.com/showthread.php?p=907567[/url]
    '
     
    LOAD "tx_format_def.pbas"                ' formatting for SEROUT
     
    PROGRAM Start
     
    Start:
     
      DO
     
        SendID ID1
     
        PAUSE 750           ' Wait for conversion
     
        SendID ID2
     
        OWREAD DQPin, value\16
     
        TX_STR "1 - "
        TX_BIN value,16
        TX_BYTE CR
     
      LOOP
     
    END
     
    '--------------------------------------------------------
    ' Jon McPhalen's TX formatting SUBs.
    '--------------------------------------------------------
    '
    ' [url=http://forums.parallax.com/showthread.php?p=907567]http://forums.parallax.com/showthread.php?p=907567[/url]
    '
     
    LOAD "tx_format_inc.pbas"
     
    SUB SendID
      RDBYTE __param1, __param2 ' Get number of bytes
      INC __param1 ' Point to 1st data byte
      DO
        RDBYTE __param1, __param3 ' Get a data byte
        OWWrite DQPin, __param3 ' Send data byte
        INC __param1 ' Point to next data byte
      LOOP __param2 ' Repeat "__param2" times
    ENDSUB
    
     
    

    The result was:

    1 - 1111111111111111

    I don't think it likes it when the bytes are sent in separate commands.· When I use your demo program

    ··· OWWRITE DQPin, $44CC\16

    works, but

    ··· OWWRITE DQPin, $44\8
    ··· OWWRITE DQPin, $CC\8

    doesn't.

    Have you tried it?· Maybe ther is something wrong with my setup.· I've got a 1K resistor between pin 16 and the DS18B20 and a 4.7K pull up resistor between the external 5V supply and the DS18B20.

    Need a drawing?

    Hank.



    ·
  • BeanBean Posts: 8,129
    edited 2010-05-26 21:48
    Hank,
    · In the command "OWWRITE DQPin, $44CC\16" the $CC is sent first (because MSB is always sent first), then $44 is sent.

    · Maybe that is the problem ???

    P.S.· The 1K resistor may be causing problems. Just run the DS18B20 from 3.3V and eliminate the 1K (keep the 4.7K pullup to 3.3V).

    P.P.S. You're not trying to use parasitic power are you ?

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]

    Post Edited (Bean) : 5/26/2010 10:00:20 PM GMT
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-26 23:00
    Bean said...
    · In the command "OWWRITE DQPin, $44CC\16" the $CC is sent first (because MSB is always sent first), then $44 is sent.

    · Maybe that is the problem ???
    Hmmm...that could be.· So I should send $BE,$46,$00,$00,$02,$7C,$B1,$D5,$28,$55?
    Then Bean said...
    P.S.· The 1K resistor may be causing problems. Just run the DS18B20 from 3.3V and eliminate the 1K (keep the 4.7K pullup to 3.3V).
    Ok...I can do that.· I'm running it off 5V because everything that I will be interfacing to likes 5V but I can take it out for testing.· Johnny Mac's Spin program works fine and it looks like he's sending $55...$BE.

     CON
      MATCH_ROM  = $55
      RD_SPAD    = $BE
     
    ow.reset               
      ow.write(MATCH_ROM)
      repeat idx from 0 to 7
        ow.write(byte[noparse][[/noparse]snpntr+idx])            
      ow.write(RD_SPAD)          
    

    I'm running his stuff against the same setup that I'm using for my testing.
    Then Bean said...
    P.P.S. You're not trying to use parasitic power are you ?
    Heck no.

    I've got to go to Ottawa for my day job tomorrow so I won't get to test the changes until tomorrow evening.· I'll post my results.

    Thanks for your help.

    Hank.
  • BeanBean Posts: 8,129
    edited 2010-05-27 00:16
    Hank,
    If you send byte at a time, then you send it in the forward order. For example to send $01, $02, $03, $04 byte at a time you would send $01, $02, $03, $04.
    But if you sent the sequence using words you would send $0201, then $0403.

    I hope that makes sense.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 12:34
    Ok...so do you want the good news or the bad news?

    First...the·bad news.

    I took out the 1K resistor and powered the DS18B20 from 3.3V.· It didn't work.

    Now, the good news.

    It works.

    I modified Bean's DS18B20 demo to send te two bytes in the correct order when I switched from sending a word to sending a byte.· That worked.

    I tossed in a·term.hex(byte[noparse][[/noparse]snpntr+idx], 2)·to Johnny Mac's modified DS1822 demo program to dump the SN as he wrote it to the 1-wire bus.· It turns out that it doesn't go out to the 1-wire bus as 46, 00, 00, 02, 7C, B1, D5, 28 but as 28,· D5,·B1, 7C, 02, 00, 00, 46.· I changed Bean's DS18B20 demo to send the bytes in he correct order and that worked.

    So...I switches back to using the 1K resistor and powering the DS18B20 with 5V and that works.

    This works:
        OWRESET DQPin
        OWWRITE DQPin, $55\8
        OWWRITE DQPin, $28\8
        OWWRITE DQPin, $D5\8
        OWWRITE DQPin, $B1\8
        OWWRITE DQPin, $7C\8
        OWWRITE DQPin, $02\8
        OWWRITE DQPin, $00\8
        OWWRITE DQPin, $00\8
        OWWRITE DQPin, $46\8
        OWWRITE DQPin, $BE\8  ' SkipROM($CC) & Read Scratch($BE)
    
    

    Everything is good.

    On another note...I've ordered one of these:

    50836-09320-1-300.jpg
    and one of these:

    21400-Parallax4x20BL-27979-L-300.jpg
    and can now move forward with my development.

    Thanks to everyone, especially Bean and Johnny Mack for kicking me in the right direction.· I really appreciate the fact that everyone was so gentle with me given that I'm new to the forum and was clearly spinning.· I'm really enjoying the Propeller and PropBASIC and am really keen to get my projects moving forward.

    Hank.
    ·
  • BeanBean Posts: 8,129
    edited 2010-05-28 13:48
    Hank,
    I glad you got it working.

    P.S. You shouldn't need the "\8" in the OWWRITE lines because 8 bits is the default.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 14:15
    Bean said...


    I glad you got it working.
    Me too, thanks.
    Bean said...

    P.S. You shouldn't need the "\8" in the OWWRITE lines because 8 bits is the default.
    Ahhh...cool...thanks.

    I have written parsers in the past and I know it's a pill...but...it would be super awesome if you could extend the OWWrite at some point to allow multiple variables on the same line.· I know how to make it work now and I know I'm being lazy but that's just the way I roll.

    Hank.
    ·
  • caskazcaskaz Posts: 957
    edited 2010-05-28 15:18
    Hi, all.

    I updated PropBASIC-bst-00.00.99-67 & bst-0.19.3.
    I cannot open lib-file(VGA.lib serial.lib etc) on BST-window.
    Need another editor?

    And what is "\" in "OWWRITE DQPin, $55\8"?
    What's it mean?

    caskaz
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 15:44
    caskaz said...
    And what is "\" in "OWWRITE DQPin, $55\8"?
    The "\8" tells OWWRITE to write 8 bits.· Bean pointed out that it wasn't necessary given that the command defaults to writing 8 bits.· I included it because the original command was OWWRITE DQPin, $BE55\16 and when I split it up I added a "\8" to each line.

    Hank.
    ·
  • YoshtiYoshti Posts: 108
    edited 2010-05-28 15:58
    Hi,
    Just off topic , for H Carr, you look familiar to me... from Ottawa, 340 Laurier.. wink.gif

    Yosh
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 16:03
    Yoshti said...


    Just off topic , for H Carr, you look familiar to me... from Ottawa, 340 Laurier..
    That's me.

    hank@dna.ca

    Hank.

    ·
  • YoshtiYoshti Posts: 108
    edited 2010-05-28 16:06
    LMAO,
    I was you worst nightmare... from NPB then to CSC. Marc Lavigne wink.gif
    Yosh..

    Sorry for hacking the thread...
    EDIT *
    Yeah just sent email. from DND.. ;-)
    I tried to go back to CSC.. got filtered out each time.. DHO !
    ~S!~~

    Post Edited (Yoshti) : 5/28/2010 4:14:30 PM GMT
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 16:10
    Yoshti said...


    I was you worst nightmare... from NPB then to CSC. Marc Lavigne
    Hey, Marc.· What a crazy way to run into each other.· Are you doing PropBASIC programming.

    You can email me at hank@dna.ca instead of continuing this on the thread (unless the others want to read this.)

    Oh...and...I'm sitting at 170 Laurier now.

    Hank.
    ·
  • YoshtiYoshti Posts: 108
    edited 2010-05-28 16:17
    ~S!~
    I looked at the prop.. and almost got it. Just it is limited with the VGA and how much I can push it.
    There was a thread about the PROP and the color display that parallax sells, can't do what I need. Ho well...
    So I'll stickwith my BS2P24 enough horsepower, and the display and stuff is done in VB2008.. works like a charm.

    One day, if I can get enough support and understanding, and don't get that &^%$#@ RTFM, as a newbie, I might evolve.. wink.gif
  • caskazcaskaz Posts: 957
    edited 2010-05-28 16:21
    Hank, Thanks to your reply.

    By the way, you can see lib-file on BST-window?
    There is not it inside list on BST-window on my PC(vista).
    Althoth there is lib-file on explorer on vista, it cannot open.

    caskaz
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 16:22
    I didn't get any RTFM from these guys.· I was most pleased.

    Have you looked at these?· Lots of grunt.

    http://propmodule.com/catalog/product_info.php?cPath=58&products_id=48&osCsid=0732bf952927103eee28f46e0423082a

    We're working on drivers for the Kyocera 5.7" flat panel.

    Kyocera%20KCS057QV1AJ-G32-tn.jpg

    Hank.

  • YoshtiYoshti Posts: 108
    edited 2010-05-28 16:32
    ~S!~
    Because I need lots of graphics, it is the PROP that does not have enough mem to push to more than one display(maximum setting).
    So, with a Notebook Acer One Aspire, and a USB Monitor, I will have enough display to get it all going.

    That display, will it be for the PROP? or the PC side...
    Yosh
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 16:35
    It is going to be driven by the Propeller (if we can make it work.)· We only need character display for what we are doing.· Eventually adding graphics may be good but for now we don't need it.

    My first crack at it will be with the monochrome 4x20 LCD and the Blackberry trackball with 4 directions and click.· I'm going to use the LEDs under the trackball to indicate status (green is good, red is bad, flashing red is very bad sort of thing.)

    Hank.
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 17:34
    Here's a fun little video that I just made.

    Do NOT try this at home!· (Well...ok...go ahead.)

    http://www.dna.ca/photos/MOV03720.MPG

    That's a can of cryo spray.

    Here's the result:
    My DS18B20s said...

    The temperature is·· 24.8125 Degrees C
    The temperature is·· 24.8750 Degrees C

    The temperature is·· 24.6250 Degrees C
    The temperature is··· 8.1875 Degrees C

    The temperature is·· 24.1875 Degrees C
    The temperature is - 19.5000 Degrees C

    The temperature is·· 23.6875 Degrees C
    The temperature is - 31.0625 Degrees C

    The temperature is·· 23.2500 Degrees C
    The temperature is - 36.3125 Degrees C

    The temperature is·· 22.8750 Degrees C
    The temperature is - 38.5625 Degrees C

    The temperature is·· 22.5000 Degrees C
    The temperature is - 38.0000 Degrees C

    The temperature is·· 22.1250 Degrees C
    The temperature is - 39.7500 Degrees C
    The unfortunate one got·down as far as - 46.8750 which is pretty darned cold.

    Hank.
    ·
  • Hank CarrHank Carr Posts: 22
    edited 2010-05-28 17:51
    Here's another:

    http://www.dna.ca/photos/MOV03721.MPG

    They went from this:
    My six DS18B20s said...

    The temperature is·· 25.0000 Degrees C
    The temperature is·· 25.0000 Degrees C
    The temperature is·· 24.8750 Degrees C
    The temperature is·· 24.8125 Degrees C
    The temperature is·· 24.7500 Degrees C
    The temperature is·· 24.5625 Degrees C
    to this:
    My six DS18B20s said...

    The temperature is -· 1.8125 Degrees C
    The temperature is - 21.6250 Degrees C
    The temperature is - 32.0000 Degrees C
    The temperature is - 22.3125 Degrees C
    The temperature is -· 5.1250 Degrees C
    The temperature is·· 10.8750 Degrees C

    So...I guess I can say that it is working now.· I'm giddy with excitement.· Or...it could be all the cryo spray in my little straw bale shed.

    Hank.
    ·
  • YoshtiYoshti Posts: 108
    edited 2010-05-28 18:28
    Hi,
    LMAO,
    I used a cube of ice to test my ds18b20. Did not go as low and as fast!
    What I like about them is , they react really fast. from an ice cube to a hot coffee cup, was about 10 secs or so (not timed).

    So, they are really sensitive to changes and fast too...
    Good Video ...wink.gif
    Cheers
    Yosh
  • JonnyMacJonnyMac Posts: 8,912
    edited 2010-05-28 19:22
    1-Wire can be very persnickety, which is why I tend to shy away from it most of the time. That said, when you need a temperature sensor and a unique serial number in a device using 1-Wire is very convenient.

    I finally found the "sweet spot" with 1-Wire vis-a-vis PropBASIC. I've attached a "work" file that demonstrates how to read the serial # from a DS1822 and then send it back to read from that device. What you want to avoid is using more than one "big" PropBASIC command in a program as each is converted to assembly inline and consumes precious cog space. My demo wraps all of the 1-Wire commands into subs/funcs so they only compile once, and I've added OW_READ_SN and OW_WRITE_SN to read and write serial numbers from the buss.

    Now that this seems to be working well I will move the 1-Wire routines to a library.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • caskazcaskaz Posts: 957
    edited 2010-05-28 23:09
    Hi, Jonny.

    Althouh unzipped ow_work_v2.zip, I cannot find delays.lib/pst_serial.lib inside ow_work_v2's folder on BST-window.
    ow_work_v2.pbas's compile-information is no error.

    Is this abnormal?


    caskaz
  • JonnyMacJonnyMac Posts: 8,912
    edited 2010-05-28 23:41
    I just downloaded the ZIP -- those files are included. I keep my .PBAS and .LIB files in the same folder and PropBASIC-BST.exe; you might give that a try.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • caskazcaskaz Posts: 957
    edited 2010-05-29 00:03
    Hi Jonny.
    I copied delays.lib/pst_serial.lib/ow_work_v2.pbas to PropBasic-bst-00.00.99-67's folder. (there is PropBasic-bst.exe inside folder)
    Opened BST-window.
    I opend PropBasic-bst-00.00.99-67's folder, but I cannot see lib-file on list.

    caskaz
  • JonnyMacJonnyMac Posts: 8,912
    edited 2010-05-29 00:12
    I understand now. Bean and I collectively decided on ".lib" but it may not be supported by BST (for display in the file pane, that is) -- you'll have to talk to Brad about that. You can open the files by using the Open dialog and then putting *.lib in the file filter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • BradCBradC Posts: 2,601
    edited 2010-05-29 00:36
    JonnyMac said...
    I understand now. Bean and I collectively decided on ".lib" but it may not be supported by BST (for display in the file pane, that is)

    It's not. I'll add *.lib to the *.pbas settings for the next release.
    <edit> If you select the (*.*) option in the file selector it should work anyway right now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Are you suggesting coconuts migrate?"

    Post Edited (BradC) : 5/29/2010 1:09:12 AM GMT
Sign In or Register to comment.