16C55 Problem.


Closed Thread
Results 1 to 4 of 4

Thread: 16C55 Problem.

Hybrid View

  1. #1
    hope_man's Avatar
    hope_man Guest

    Default 16C55 Problem.

    I'm using a 16c55/RC MCU with a 1k/10pF external RC oscillator. MCLR is not connected. supply is 5v. And the following program is not working. IT compiles fine. and writes fine to the MCU. I'm using PicBasic Pro 2.46 and a 865 Universal device programmer from BK precision with the latest software. HEre is my source. Thanks for helping me.


    '0000 = Analog Input Channel 0
    '0001 = Analog Input Channel 1
    '0010 = Analog Input Channel 2
    '0011 = Analog Input Channel 3
    '0100 = Analog Input Channel 4
    '0101 = Analog Input Channel 5
    '0110 = Analog Input Channel 6
    '0111 = Analog Input Channel 7
    '1000 = Digital Out
    '1001 = Digital In
    '1010 = Relay Out
    '1111 = RESET
    '--------------------------------------------------

    COMMANDE var PORTA ' Alias du port de commande
    DATABUS var PORTB ' Alias du port data (DEBUG inutiliser)
    SELECTLINE var PORTC ' Port de selection et d'address

    ADC_0 con 0
    ADC_1 con 1
    ADC_2 con 2
    ADC_3 con 3
    ADC_4 con 4u
    ADC_6 con 6
    ADC_7 con 7
    DIGITAL_IN con 8
    DIGITAL_OUT con 9
    RELAY_OUT con 10
    RESET con 15

    TRISA = %1111 ' PORT A input (Commande)

    TRISB = %11111111 ' Port B input (Data DEBUG)

    TRISC = %00000000 ' PORT C output (Address,Chip Select)


    'Description du bus SELECTLINE
    'bit0 = LSB de l'adress du canal de l'ADC
    'bit1 = ''
    'bit2 = MSB de l'adress du canal de l'ADC
    'bit3 = CS de l'ADC
    'bit4 = ERROR LINE
    'bit5 = CS de DIGITAL_IN
    'bit6 = CS de RELAY_OUT
    'bit7 = CS de DIGITAL_OUT

    loop:
    select case COMMANDE
    case ADC_0
    SELECTLINE = %00001000 ' CANAL 0 , CS ON
    case ADC_1
    SELECTLINE = %00001001 ' CANAL 1 , CS ON
    case ADC_2
    SELECTLINE = %00001010 ' CANAL 2 , CS ON
    case ADC_3
    SELECTLINE = %00001011 ' CANAL 3 , CS ON
    case ADC_4
    SELECTLINE = %00001100 ' CANAL 4 , CS ON
    case ADC_5
    SELECTLINE = %00001101 ' CANAL 5 , CS ON
    case ADC_6
    SELECTLINE = %00001110 ' CANAL 6 , CS ON
    case ADC_7
    SELECTLINE = %00001111 ' CANAL 7 , CS ON
    case DIGITAL_IN
    'select DIGITAL IN
    SELECTLINE = %00100000
    case DIGITAL_OUT
    'select DIGITAL OUT
    SELECTLINE = %10000000
    case RELAY_OUT
    'select relay out
    SELECTLINE = %01000000
    case RESET
    'etat nul
    SELECTLINE = %00000000
    case else
    'bit 4 on ERROR
    SELECTLINE = %00010000
    end select
    Goto loop ' repete pour toujours
    End

    This program uses the table at the beginning as command. They are sent to PORTA which is 4bit, compare the command received in the select case block and then send the output on portc. THIS IS WHAT IT is supposed to do but it does not work.


    PLEASE HELP!!!

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


    Did you find this post helpful? Yes | No

    Default

    What about your Config fuses?

    Did you test your stuff with a super duper Led Blinking program first before?

    Look Section 4.4 for the R/C choice.. you'll discover some limitations...

    La vie est une salope desfois
    Steve

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

  3. #3
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Unless my memory is playing tricks with me, i'd say that you MUST connect MCLR to +5V.

  4. #4
    hope_man's Avatar
    hope_man Guest


    Did you find this post helpful? Yes | No

    Default

    Yeah.... It works with the MCLR to 5v.... thanx.. I was just so lunatic

Similar Threads

  1. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  2. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 21:04
  3. Hardware problem or what ?
    By Steve S. in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 4th March 2007, 21:39
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

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