First time with 18F pic...


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    18

    Unhappy First time with 18F pic...

    Hello,

    I ran out of space when writing a program for the PIC16C66 (original was in assembler, but wanted to port it to PBP for ease of updating). So I got a PIC18F2610, after modifying the necessary assembler routines, configuration registers, etc. The original program that was running perfectly in the 16C66 compiled fine, but didn't work at all in the 18F2610.
    So being a first timer with a 18F pic I decided to start from the beginning and try the led flasher program, no problem there, so the pic is fine so far. But then I tried this small routine of the program, really straightforward and with no fancy coding:

    'Port Asignment
    'PortA.3 Serial output to LCD
    'PortA.5 MCLR for LCD
    'PortC.2 Led

    DEFINE OSC 20
    DEFINE NO_CLRWDT 1

    Init_LCD:
    HIGH PortA.3 'Initial state of serial line
    HIGH PortA.5 'Enable LCD
    PAUSE 100 'Wait for LCD to start
    SEROUT2 PortA.3,84,["U"] 'Set transmision speed
    PAUSE 60
    SEROUT2 PortA.3,84,[$01] 'Clear LCD
    PAUSE 5
    SEROUT2 PortA.3,84,[$0C] 'Turn off insertion point
    PAUSE 5
    SEROUT2 PortA.3,84,["Printer Control",$00,$40,"v 3.0"] 'Display message
    PAUSE 4000 'Wait 4 secs.
    SEROUT2 PortA.3,84,[$01] 'Clear LCD

    Loop:
    TOGGLE PortC.2 'Flash LED when finished
    PAUSE 1000
    GOTO Loop

    END

    As you can see there is not much about it, and this same code works perfectly on the 16C66. I tried different configurations of the processor but no luck. The only thing that works fine is the led flashing at the end.
    The serial output for the LCD goes to another PIC board that interfaces an LCD thru a serial port, this has been used in many different projects without a problem, just in case you are wondering.

    If you can share any info on how to make this PIC work I will really appreciate it.

    Thanks in advance,

    Gabriel

  2. #2
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Has PortA been changed to digital outputs?
    Last edited by Peder; - 9th December 2005 at 06:25.

  3. #3
    Join Date
    Nov 2005
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    He, he, he...

    Got me!!!

    I've forgotten completely about the Analog capabilities of this device, as I was never using them...

    Thanks a lot...

    Gabriel

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. Can a PIC PIC a PIC?
    By afbecker in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2008, 19:55
  4. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24

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