PIC 18F4550, firmware


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    May 2007
    Posts
    21

    Default PIC 18F4550, firmware

    Hi,

    I recently started to use PICBASIC PRO, and trying to write a code which will simply light a led. While using bootloader I recognized that I need to allocate some free space for firmware. How can I do this in PICBASIC? In CCS C, it is possible to write such a code like this.

    #build (reset=0x800)
    #build (interrupt=0x808)
    #org 0x0000, 0x07ff
    void bootloader () {

    #asm
    nop
    #endasm
    }

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    Hi,
    I recently started to use PICBASIC PRO, and trying to write a code which will simply light a led. While using bootloader I recognized that I need to allocate some free space for firmware. How can I do this in PICBASIC? In CCS C, it is possible to write such a code like this.
    #build (reset=0x800)
    #build (interrupt=0x808)
    #org 0x0000, 0x07ff
    void bootloader () {
    #asm
    nop
    #endasm
    }
    Which bootloader are you using?
    Which PIC are you using?
    Which version of PBP are you using?
    Why would you need to allocate free space for firmware while using a bootloader?
    How complicated is this 'shine an led' program of yours?

  3. #3
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I guess, firmware needs first 2kb of the memory.Therefore the first 800h bits must be allocated...

    PIC18F4550
    PICDEM FS USB DEMO TOOL VERSION 1.00

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    I guess, firmware needs first 2kb of the memory.Therefore the first 800h bits must be allocated...

    PIC18F4550
    PICDEM FS USB DEMO TOOL VERSION 1.00
    As long as your bootloader is supported by PBP, then you shouldn't have to worry about anything.
    What about the rest of the questions?

  5. #5
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Define ONINT_USED 1

    LED var PORTL.0 ' Alias PORTB.0 to LED

    loop: High LED ' Turn on LED connected to PORTL.0
    Pause 500 ' Delay for .5 seconds

    Low LED ' Turn off LED connected to PORTL.0
    Pause 500 ' Delay for .5 seconds

    Goto loop
    End
    This is a simple example from the guide.
    Do I need to define anythin further? osc 20mhz?

    PBP 2.46

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    Define ONINT_USED 1
    LED var PORTL.0 ' Alias PORTB.0 to LED
    loop: High LED ' Turn on LED connected to PORTL.0
    Pause 500 ' Delay for .5 seconds
    Low LED ' Turn off LED connected to PORTL.0
    Pause 500 ' Delay for .5 seconds
    Goto loop
    End
    This is a simple example from the guide.
    Do I need to define anythin further? osc 20mhz?

    PBP 2.46
    Which page is 'Define ONINT_USED 1' on in the guide?

    And since when does a PIC18F4550 have a PortL?

  7. #7
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    PORTL.0 is a user defined variable for PORTB.0
    PAGE 6

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    PORTL.0 is a user defined variable for PORTB.0
    PAGE 6
    It is? That's a good trick! How about this...
    PortL encompasses pins 0 - 7 (PortB for a 40 pin PIC), and PortH encompasses pins 8-15 (PortC for 40 pin PIC).
    At least they do according to pg.26 and 27 (section 4.11).

    Now then, how about the rest of the questions...again...

  9. #9
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    PBP 2.46
    mplab ICD 2 as programmer
    mplab IDE 7.5

    anything missing?

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    PBP 2.46
    mplab ICD 2 as programmer
    mplab IDE 7.5

    anything missing?
    Yep...see post #6...
    What does 'Define ONINT_USED 1' mean?

  11. #11
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I don't know exactly what it means. Actually this is a sample code from PBP. The name is Blink.bas

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    I don't know exactly what it means. Actually this is a sample code from PBP. The name is Blink.bas
    And it probably says it was written for an older version of PBP.
    If you do a search here for ONINT_USED, you'll see why that isn't going to work for you...

  13. #13
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    thanks a lot, it works...

  14. #14
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kutsi View Post
    thanks a lot, it works...
    Good deal...
    That's probably my one time this month I'll be of any use to anybody. The rest of this month, I'm just going to sit in a pile of my own drool...

Similar Threads

  1. Pic to Pic Firmware upgrade
    By rjones2102 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th October 2007, 00:06
  2. getting started with a PIC 18F4550
    By bigbear in forum General
    Replies: 2
    Last Post: - 16th October 2006, 02:31
  3. Build PIC bootloader firmware in PBP?
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th August 2006, 19:53
  4. Pic 18F4550 & VB6
    By lentz in forum USB
    Replies: 1
    Last Post: - 5th April 2006, 00:55
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

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