12f675_fuse_about_to_blow! - Page 20


Closed Thread
Page 20 of 24 FirstFirst ... 10161718192021222324 LastLast
Results 761 to 800 of 929
  1. #761
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    I've posted it over on the VB thread (link below). Will be interesting to see if anyone has any ideas.

    http://www.picbasic.co.uk/forum/show...3607#post93607

    Dave

  2. #762
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    Henrik looks like he's cracked the problem over on the VB thread.

    I'll work on it tonight.

    Dave

  3. #763
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I saw that.
    Seems obvious now.
    Dave
    Always wear safety glasses while programming.

  4. #764
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    Seems obvious now.
    That's because your'e clever. Hopefully I'll say that one day.

    I've just posted a reply to Henrik on the VB thread (link below).

    In a nutshell, the VB program is reading and displaying Random Bytes a treat now Apparently though birds fly in and out of nest boxes a lot more the 255 times a day when they're feeding young (It'll be interesting to see just how many) so a Word is needed as a counter, so half way there now then.

    http://www.picbasic.co.uk/forum/show...3663#post93663

    Dave

  5. #765
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I have been called many things, clever has not been one of them

    Birds..
    WORD size , I would think will be large enough for a day? Week? Sooner or later that will not be large enough.

    So when counting you can go very large even using BYTE size. Have the count be a power of 100.

    A simple example.
    Count to 100 with VAR1. When 100 is reached VAR2 increments and VAR1 starts over.
    VAR2 will have 100s and VAR1 will have ones and tens.

    But get the WORD thing working
    Dave
    Always wear safety glasses while programming.

  6. #766
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Count to 100 with VAR1. When 100 is reached VAR2 increments and VAR1 starts over.
    VAR2 will have 100s and VAR1 will have ones and tens.
    See what I mean, very clever

    But get the WORD thing working
    I'll be on it tonight And probably tomorrow night too.

    Dave

  7. #767
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    But get the WORD thing working
    I think it is

    Have a look at the screen-shot on the other thread, what do you think?

    http://www.picbasic.co.uk/forum/show...3747#post93747

    Dave

  8. #768
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Thumbs up

    looks good!!!

    You are doing a fine job

    And yes, I am following the other thread..
    Dave
    Always wear safety glasses while programming.

  9. #769
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    You are doing a fine job
    Cheers mackrackit, I wouldn't be without your and Henriks help though.

    Yes the bare bones are taking shape with the Form, a lot of tweaks could be made though (having the COM Port open / shut automatically, clearing the buffer etc).

    Next job to get the PIC to send High then Low Bytes and have VB join them back into a Word.

    Fascinating stuff this.

    Dave

  10. #770
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    Should I carry on tweaking the VB Terminal program for now or look at the rfPIC-TxRx program?

    It's amazing how even learning how to make what appears to be the simplest of changes can take a whole evening. Sometimes I don't even know the term for what it is I'm trying to achieve / change...doh.

    Dave

  11. #771
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looks like you have VB under control for what you want to do to start with.
    Might as well work on the RF some.

    I know what you mean about terms and things. One of the problems with being self taught I guess.
    Dave
    Always wear safety glasses while programming.

  12. #772
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Looks like you have VB under control for what you want to do to start with.
    Yes, having a VB Terminal program via a usb / db9 cable that magically receives Random numbers from the PIC to pc is a result alright

    I've managed to get a txt file to open with a button click to write the Bird count Bytes to.

    Seriously interesting stuff this.

    Dave

  13. #773
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    I haven't left the Country. I've had a few things to deal with of late but still learning in between times.

    Dave

  14. #774
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I figured as much.
    Are you working on RF or VB lately?
    Dave
    Always wear safety glasses while programming.

  15. #775
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Are you working on RF or VB lately?
    I've spent some time looking at Bruce's rx / tx program to try and figure out 1/ exactly how it works and 2/ To modify it to transmit (and then receive) firstly a byte, then a word to send to the Terminal program.

    On the VB front, I'm looking to make the VB Terminal program read the transmitted data from the PIC and auto-write that information to a txt file.

    I guess I'm riding two horses (and juggling three balls in my private life right now). I guess I should focus on one (the VB or the rx/tx that is).

    Dave
    Last edited by LEDave; - 30th September 2010 at 14:31.

  16. #776
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    Are these 'private messages' you can send on this Forum private / ish.

    Dave

  17. #777
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Yes, they are private.
    Dave
    Always wear safety glasses while programming.

  18. #778
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi everyone,

    I've just managed to get the rfPIC TX/RX to work and blink the two led's on the PICkit1. It took me over an hour to figure out and find which program and where the program was on my hdd (must improve my house keeping). I still find it amazing that it's radio waves travelling through the air that makes all this work.

    Ok, so the program's I used were the microchip rx/tx.hex demo program's written in assemly language. However, for the project I need to compile Bruce's TX / RX program's which are written in PB with a little assembler in the mix and compile them using the MPLAB compiler (have I got that right?) then modify the code for the project.

    So step one, I need to go away and learn how to compile a program and create a hex file using MPLAB (something I've never done before) I'm pretty sure I've a tutorial somewhere.

    Just a little refresher, am I right in thinking that PBP compiles PIC Basic and MPLAB compiles everything, well PIC Basic and Assembly?

    Good to be back.

    Dave
    Last edited by LEDave; - 2nd November 2010 at 21:29.

  19. #779
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You do not have to use MPLAB. MPLAB is just an editor, basically.
    But you do or should be using MPASM.
    To do this with Micro Code Studio go to Tools- Compiler Options then the assembler tab. Check MPASM.

    Good to have you back.
    Dave
    Always wear safety glasses while programming.

  20. #780
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Good to have you back.
    Cheers mackrackit

    To do this with Micro Code Studio go to Tools- Compiler Options then the assembler tab. Check MPASM.
    Well I can't actually see 'Tools' on the toolbar, here are three screen shots which I think show my current setup:
    Attached Images Attached Images    

  21. #781
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I thought I'd add a screenshot of the 'toolbar' so you can see what I've got highlighted and what's greyed out under current settings. Does this look ok to you?
    Attached Images Attached Images  

  22. #782
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    That looks about right for that chip. You should have save available though! Maybe you need to have some code in the window for that. Looks like most of the greyed out options are for the in circuit debuger. Some other chips: 16F627(A), 16F628(A), 16F73, 16F74, 16F76, 16F77, 16F870, 16F871, 16F873(A), 16F874(A), 16F876(A), 16F877(A), 16F87, 16F88, 18F242, 18F248, 18F252, 18F258, 18F442, 18F448, 18F452, 18F458, 18F1220, 18F1320, 18F2220, 18F2320, 18F4220, 18F4320, 18F6620 and 18F8620

    have an in circuit debug available for them, but as you can see, they are a bit limited. It is an interesting feature though.

    Walter

    Name:  mybar.PNG
Views: 777
Size:  32.7 KB
    Last edited by ScaleRobotics; - 3rd November 2010 at 00:58.
    http://www.scalerobotics.com

  23. #783
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Walter

    You should have save available though! Maybe you need to have some code in the window for that.
    Exactly that, I added some code and 'Save' changed from greyed out to Bold.

    That was interesting, I changed the chip from a 12F675 to a 16F627(A) and the RUN-STOP-STEP-PAUSE changed from greyed out to Bold,
    like you said then that must be because the chip has a Debug available to them (I've never used Debug).

    Cheers: Dave
    Last edited by LEDave; - 3rd November 2010 at 01:55.

  24. #784
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LEDave View Post
    (I've never used Debug).
    Hi Dave,

    Bruce did a great write up on how to use it here: http://www.rentron.com/PicBasic/MCS_X3.htm

    I used to use it, and it is pretty cool. When I needed to try to debug things that were using the serial port already, I had to find other ways to debug (not necessarily better). But I would say it can be pretty helpful when you are starting out.

    The way it debugs is that it adds code into your program to talk back and forth through the serial port. That way it updates registers, etc so you can see them in the ICD. It uses a fair amount of resources, so it slows things down a great deal, but it is fast enough for a lot of projects.
    Last edited by ScaleRobotics; - 3rd November 2010 at 02:10.
    http://www.scalerobotics.com

  25. #785
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Thanks for that Walter and the link, very interesting and something else to look into.

    Dave

  26. #786
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    We've touched on this before, when I compile Bruce's TX program I get these errors (see attachment). This is because as mackrackit said earlier in the thread:

    Bruce is using PM for an assembler in that example.
    And:

    PM is the assembler from the Pic Basic folks. It works well on the older and smaller chips.
    Also:

    MPASM from MicroChip works for everything.
    So the compiler error is due (I think) to having the wrong type of configuration fuse in Bruce's program (see second attachment) and I need to change them to this type (see third attachment) and it will compile.

    Have I got that right?

    Dave
    Attached Images Attached Images   
    Attached Files Attached Files

  27. #787
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You will want to change these lines in your code
    Code:
    @ DEVICE PIC12F675,MCLR_OFF,INTRC_OSC_NOCLKOUT,WDT_OFF,BOD_OFF
    @ DEVICE PWRT_ON,PROTECT_OFF
    to
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    when using MPASM as an assembler.

    And comment the *.inc file in the PBP directory.

    http://www.picbasic.co.uk/forum/cont...o-your-Program
    Dave
    Always wear safety glasses while programming.

  28. #788
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    Well I changed the lines of code and compiled the program without commenting the the *.inc file in the PBP directory and the compiler gave the error below(see attachment). I was expecting that as per your Forum link.

    It's the
    comment the *.inc file in the PBP directory.
    that's causing me the problem and I've conFUSED myself big time here. The only .INC files I can find are in this path:C:\Program Files\Microchip\MPASM Suite. I've read the Forum page link you posted up but I still can't see what I need to do.

    Another pointer if poss please.

    LedimDave
    Attached Images Attached Images  

  29. #789
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    C:\PBP
    That is where the inc's are. If things are installed in the default location.
    The ones in the MPASM directory do not modify.
    Dave
    Always wear safety glasses while programming.

  30. #790
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Can't believe I couldn't find the PBP.INC files talk about under my nose

    Anyway moving on, I've found the 12F675.INC (PBP) file and think I've 'commented out' the right line (see attachment) which probably means I haven't Is what I've done what I'm meant to do?)

    Code:
    ;device  pic12F675, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
    Dave
    Attached Images Attached Images  

  31. #791
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Yes, that is the correct line to comment when setting the fuses PM style in code space. Comment the line starting "__ config" when using MPASM style.
    Both can be commented at the same time.
    Dave
    Always wear safety glasses while programming.

  32. #792
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    Both can be commented at the same time.
    I did both and the TX program compiled with no errors In the morning I'll change the RX fuses and then it's onto the programs themselves to send and receive the bird_box_count_data, exciting stuff.

    Dave

  33. #793
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I've had a good night tonight. I've managed to get Bruce's RX program which uses a PIC12F676 (which I don't have) to work on a 16F684 which I do, so well pleased.

    Dave

  34. #794
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    WOOHOO!!!
    Now you getting it. Good job!!!
    Dave
    Always wear safety glasses while programming.

  35. #795
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    WOOHOO!!!

    Now you getting it.
    Well another step forward for sure

    Good job!!!
    Cheers mackrackit.

    Dave

  36. #796
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    In Bruce's TX program under the section of Constants, he has PreAmble CON with a value of 15 HEX (I'm happy with that) Then he has Synch CON "~" = 7E HEX(I think) but how does "~" = anything if you see what I mean?

    Code:
    ' Constants
        PreAmble CON $A5    ' 10100101 preamble
        Synch    CON "~"    ' 01111110 synch byte
    Dave

  37. #797
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    In Bruce's TX program under the section of Constants, he has PreAmble CON with a value of 15 HEX (I'm happy with that) Then he has Synch CON "~" = 7E HEX(I think) but how does "~" = anything?

    Code:
    ' Constants
        PreAmble CON $A5    ' 10100101 preamble
        Synch    CON "~"    ' 01111110 synch byte
    *** Ah, I just figured it out 7E HEX is the ASCII value for the ~ symbol right?***

    So sending and receiving that symbol acts as a Synch BYTE is that right?

    Plus sorry I seem to have posted twice instead of editing.

    Dave

  38. #798
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    ""So sending and receiving that symbol acts as a Synch BYTE is that right?""
    Yup.
    Dave
    Always wear safety glasses while programming.

  39. #799
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Cheers mackrackit.

    It's a funny game this programming, I've been scratching my head for ages trying to figure out how the Synch BYTE worked, then when the penny dropped it all seemed fairly obvious (it didn't until the penny dropped though). Still, another piece fits into the learning jigsaw I guess.

    Dave

  40. #800
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I've been doing lots of reading and slowly trying to work my way through the TX / RX progs to get an understanding of what's actually happening, the sequence etc. One thing I can't see though is this.

    In the TX program we've got:

    Code:
    SEROUT2 D_OUT,BAUD,[PreAmble,Synch,DAT_OUT,DAT_OUT,CHK_SUM]
    And the RX has:

    Code:
    SERIN2 D_IN,N2400,[WAIT(Synch),DAT_IN1,DAT_IN2,CHK_SUM]
    So my Q is this: What's happened to the 'PreAmble BYTE' ?

    Code:
    PreAmble CON $A5    ' 10100101 preamble
    The Manual says:

    The list of data items to be received may be preceded by one or more qualifiers between parenthesis after WAIT. SERIN2 must receive these bytes in exact order before receiving the data items. If any byte received does not match the next byte in the qualifier sequence, the qualification process starts over
    So in this case that would be the Synch BYTE right? Synch BYTE always first (because of the WAIT command), the rest to follow. I can't see where / how the preAmble arrives though.

    Also this from WIKI:

    http://en.wikipedia.org/wiki/Syncword

    Suggest to me that a PreAmble and a Synch are two ways of doing the say thing, or very similar, have a got that on right?

    Dave
    Last edited by LEDave; - 8th November 2010 at 21:54.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts