PIC 18F2220 from hell


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hi and welcome here.

    There's a few things you have to change and delete. Let's see
    Code:
    @ INCLUDE "P18F2220.INC"	 ;processor specific variable definitions
    @	LIST P=18F2220 ;directive to define processor and file format
    you don't need them, PBP do it for you, just delete those lines above

    Code:
    DEFINE OSC = 20
    must be written like
    Code:
    DEFINE OSC 20
    However, with this changed, you'll also need to change your OSC mode in your config fuses... and then you'll probably have a list of Error[118]... read the following thread (at least post 1 and 5)
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    Code:
    RCSTA = $FAB
    TXSTA = $FAC
    SPBRG = $FAF
    kinda hard to fit a 12bit result in a 8bit register Your program don't use the USART as it use a bit-banged solution (SERIN2/SEROUT2). If you want to use the USART, have a look in your manual for HSEROUT/HSERIN

    HTH
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Oct 2008
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Hello Steve,

    Thank you for your reply. I was not sure if i need those first two lines of code. I will apply your recommendations when i get home.

    Using HSERIN, will it read data @ 38.4K assuming I DEFINE the correct BAUD and SPBRG?

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes it will work. In fact you can change the baudrate on the fly if you need. If you do so, you'll need to change the SPBRG value.

    Have a look at my PicMultiCalc, kinda handy stuff to calculate the SPBRG register

    Download it here
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Oct 2008
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Hello Steve,

    Your advice was right on. Thank you for taking the time to respond. Wihile i am fairly new to this forum, I have learned a lot from you and others who contribute to this forum regularly. The PicMultiCalc tool was very useful i will make good use of it. Thanks again.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  2. Replies: 67
    Last Post: - 8th December 2009, 03:27
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 22:01
  4. Trouble with PIC 18F2220
    By cpayne in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th August 2005, 14:17
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00: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