MCSPlus serial interface to EasyPIC6 not working?


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    I've never used this board, but it looks like there's a ton of jumpers on there. And if you're not getting even an LED to blink, I would bet you're just missing a jumper setting!

    Might even try replacing the PIC.

    Is the POWER LED ON?
    Last edited by Bruce; - 5th March 2010 at 05:59.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default

    Quote Originally Posted by Bruce View Post
    I've never used this board, but it looks like there's a ton of jumpers on there. And if you're not getting even an LED to blink, I would bet you're just missing a jumper setting!

    Might even try replacing the PIC.
    I just burned a test program into the chip via same programming path I've been using that is a "blinky LED". It works fine. This tells me that at least the MCU chip will run and is OK. However, from what I saw that I described in my previous post, the serial interface code is NOT running in the MCU. Don't know why it would run with one program and not the other???

    Is the POWER LED ON?
    [/QUOTE] Yes it is.

    I just was wondering if it might be the USB to Serial converter cable I have to use because the Laptop I am using doesn't have a true serial (RS232) interface connector. I am using an ATEN UC232A USB-to-serial converter cable that connects to the DB9 connector on the EasyPic6 serial interface. It has a light built in to the serial end of the cable that comes on when the TX and RX switch selections are correct on SW7 and SW9 and the MCU is powered up. I have heard before that some of these USB to serial cables don't always work with some serial interfaces. Have any ideas about this one?
    If that isn't it, then it is looking more and more like a failure in one of the compnents in the EasyPic6 serial circuit.....possibly the MAX202 they use...just don't know how to text the circuit to see if it is a H/W failure.
    I'm really running out of ideas.
    Last edited by jellis00; - 5th March 2010 at 06:39.

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

    Default

    You could test the board by removing the PIC and VERY VERY carefully plug a jumper wire in across the PIC TX/RX pin sockets. That will give a loop back to the PC when something is sent.

    And/or

    Program the chip, put it ina breadboard then connect to the PC. If you have the hardware.
    Use SEROUT2 with an inverted MODE then an inverter chip is not needed. Send "hello wold" like Bruce mentioned.

    Jump pins 2 and 3 at the USB/serial converter and do a loop back test.

    With out an "O" scope, write a code to send something in a loop, something long. with a second pause between sends. Connect a DVM to zero and serial pin #2 of the EasyPic and see it the is any activity from the on-board inverter chip. If the DVM fluctuates then the inverter chip is probably working.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default

    Quote Originally Posted by mackrackit View Post
    You could test the board by removing the PIC and VERY VERY carefully plug a jumper wire in across the PIC TX/RX pin sockets. That will give a loop back to the PC when something is sent.
    Tried this and got no loop back to the PC terminal display. Also put an O-scope on the jumper and see no activity when typing characters on the PC keyboard. That tells me no transmissions are reaching the RX pin on the MCU on the EasyPic6...possibly MAX202 or USB-to-serial cable bad?

    [QUOTE]
    Jump pins 2 and 3 at the USB/serial converter and do a loop back test.
    [\QUOTE]
    Did this and type characters at the PC keyboard and no loop back characters on the RX side of the terminal. Also connected an O-scope to Pin-2 of the Male DB9 connector (TX from PC) and no activity when typing characters on PC keyboard. This test tells me that the UC232A cable (USB-to-serial) is probably not wired correctly for USB to serial conversion. It still doesn't eliminate the MAX202 as the problem.

    .....Connect a DVM to zero and serial pin #2 of the EasyPic and see it the is any activity from the on-board inverter chip. If the DVM fluctuates then the inverter chip is probably working.
    By this do you mean connect the DVM to check for voltage at the MCU's RX pin socket location on the EasyPic6 with the MCU removed? I don't undersand which serial pin #2 you are referring to. It seems to me that connecting to the RX socket location would also confirm whether the inverter chip is working as long as I know the cable is good. Would appreciate your clarification on that.

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

    Default

    By this do you mean connect the DVM to check for voltage at the MCU's RX pin socket location on the EasyPic6 with the MCU removed? I don't undersand which serial pin #2 you are referring to. It seems to me that connecting to the RX socket location would also confirm whether the inverter chip is working as long as I know the cable is good. Would appreciate your clarification on that.
    Serial pin#2 would be the RX from the test board. I did not know that you have an O scope.
    Write a code to send serial data and connect your scope to the EasyPic board. That will tell you if anything is getting out.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default EasyPic6 serial interface works w/ mBasic but not PBP??

    Have made some progress in isolating the problem. Finally found a laptop with true serial interface so I could avoid use of USB-to-serial adapter cable. To confirm EasyPic6 interface was working I programmed a PIC16F877 chip with the standard loopback test mikroBasic code that came as sample with the EasyPic6. With this code the serial interface worked fine. This confirms there is nothing wrong with the serial interface hardware in the EasyPic6. For reference here is that simple code:
    Code:
    ' *
    ' * Project name:
    '     UART (Simple usage of UART module library functions)
    ' * Copyright:
    '     (c) Mikroelektronika, 2009.
    ' * Revision History:
    '     20080930:
    '       - initial release;
    '       - 20090720 - modified by Slavisa Zlatanovic;
    ' * Description:
    '     This code demonstrates how to use uart library routines. Upon receiving
    '     data via RS232, MCU immediately sends it back to the sender.
    ' * Test configuration:
    '     MCU:             PIC16F887
    '                      http://ww1.microchip.com/downloads/en/DeviceDoc/41291F.pdf
    '     Dev.Board:       EasyPIC6
    '                      http://www.mikroe.com/en/tools/easypic6/
    '     Oscillator:      HS, 08.0000 MHz
    '     Ext. Modules:    -
    '     SW:              mikroBasic PRO for PIC
    '                      http://www.mikroe.com/en/compilers/mikrobasic/pro/pic/
    ' * NOTES:
    '     - RX and TX UART switches on EasyPIC6 should be turned ON (SW7.1 and SW8.1).
    ' *
    
    program UART
    dim uart_rd as byte
    
    main:
      UART1_Init(9600)                     ' Initialize UART module at 9600 bps
      Delay_ms(100)                        ' Wait for UART module to stabilize
    
      UART1_Write_Text("Ready")
      UART1_Write(10)                      ' Line Feed
      UART1_Write(13)                      ' Carriage Return
    
      while (TRUE)                         ' Endless loop
        if (UART1_Data_Ready() <> 0) then  ' If data is received,
          uart_rd = UART1_Read()           ' read the received data,
          UART1_Write(uart_rd)             ' and send data via UART
        end if
      wend
    end.
    Then I programmed my 18F4550 with the below PBP code that is an adaptation I got from Mackrackit. Although the code compiles and runs, the serial interface doesn't work....no character loopbacks to Hyperterminal when typed and an oscilloscope connection to the RX pin of the 18F4550 shows nothing when characters are typed into Hyperterminal.

    I have studied the code in both cases and see little functional difference. Yet one works and the other doesn't.
    Can anyone advise me what changes to make to the PBP code to get it to work??
    Code:
    'ASM ; 18F2550/4550, 8mhz crystal
    '   __CONFIG   _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
    '   __CONFIG   _CONFIG1H, _FOSC_HSPLL_HS_1H
    '   __CONFIG   _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
    '   __CONFIG   _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    '   __CONFIG   _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
    '   __CONFIG   _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    
    'ENDASM
    Include "Modedefs.Bas"
    
    DEFINE OSC 16
    
    'Register Settings
        RCSTA = $90   ' Enable serial port & continuous receive
        TXSTA = $24   ' Enable transmit, BRGH = 1
        SPBRG = 160   ' 9600 Baud @ 16MHz, -0.08%
        SPBRGH = 1
    '    BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
        
        TRISB = %00000000	        ' Set PORTB to outputs as test LEDs
    INCLUDE "ALLDIGITAL.pbp"    ' Sets all registers for digital ops.
                                ' User must make sure the AllDigital.pbp file 
                                ' is in same directory location as this source
                                ' code before compiling.
        PORTB = 0               ' Turn off the LEDs
        HIGH PORTB.4            ' Blink the one Test LED as proof MCU is running
        PAUSE 500
        LOW PORTB.4
    
    ' Declare variables
    X VAR BYTE
    
    START:
        RCSTA.4 = 0 : RCSTA.4 = 1
        HSERIN [DEC X]
        PORTB.5 = 1         ' Turn on PortB.6 LED if this statement is executed
                            ' as test of receiving a character
        HSEROUT [DEC X,$d,$a]
        PORTB.6 =1          ' Turn on PortB.7 LED if this statement is executed
                            ' as test of HSEROUT having sent a character
    GOTO START

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Hint:

    There are 2 buttons available in mister-e's program ...

    DT

Similar Threads

  1. Please help with EDE702 - Serial to LCD interface
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th October 2008, 03:48
  2. 32-bit Quadrature Counter With Serial Interface
    By precision in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th June 2008, 03:49
  3. Serial interface with RFID reader
    By brid0030 in forum Serial
    Replies: 8
    Last Post: - 23rd January 2007, 07:23
  4. Replies: 0
    Last Post: - 25th November 2005, 15:35
  5. PIC16F877 to RFID Module Serial Interface
    By koossa in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2005, 07:03

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