Page 12 of 13 FirstFirst ... 2910111213 LastLast
Results 111 to 120 of 122
  1. #111

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550


    TTL naman ang other end ana bro noh? Mas ok na kay no need na ug max232. Di madala ug 100 na? Hehe

  2. #112

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Quote Originally Posted by red_horse View Post
    Dili ko master hah. Pareha lang ta newbie. Maybe nakauna lang ko nimo ug one week. Hehe. If wa jud ka hardware yah you really need it. Gamiton na sya para maka communicate imong C# program sa imo simulation sa proteus. Bali mo open na sya ug virtual na serial port. So basically mao na sya'y imo serial cable from your pc na i-connect sa padung sa PIC. naka try nako ana, very useful kaau na. Nalimot nako atong ako gigamit na virtual port SW. Di man gud laptop ako gigamit ron bossing, that is why daghan typo, hehe. Tommorow i'll give you the name sa SW ako gigamit.
    @red_horse,Bro tudlo-i daw ko unsaon pag gamit aning Virtual Port, wa may klaro sa katong tutorial gud.... igo rman niya gi add pair nya ni run nadayun ang simulation sa proteus.... need jud ko help ani hapit na baya deadline.... T_T

  3. #113

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    YES!bag-o pagyud na kuha, salamat sa mga nitabang,
    nakuha na nako para maka communicate sa C# program sa ako simulation sa proteus...
    salamat i-actual nani nako! salamat mga Master!
    mangutana lng ko balik dere mga Master kong mapoblema ko balik.. salamat sa tanan..

  4. #114

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Ahak, bai @red_horse naa napud ko problem,
    ahak dle man cya mo gana sa actual na gyud, sa simulation gana kaau.. ako ra gyud ni gisuon ang naa sa Proteus nga circuit deli man cya mo gana......
    ako gi gamit kay Serial-to-rs232 kon ako gi direct sa LED ang pin3(transmit data Tx) inig click nako sa c# nga button mo sige cya so meaning ok ra ba ang USB-to-rs232? or sa ako ni PIC ang problema..?

  5. #115

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Dili mi maka tag-an ana bro since wala man ka gapakita sa imo codes or circuit.
    But there are ways to debug both your hardware and software.

    Let us start sa hardware.
    First do an echo test sa PC side.

    I assume gagamit ka ug ug max232/max3232.
    I-short ang pin11 and pin12 or pin9 and pin10 sa max232/max3232 depende ug asa nimo gi-connect ang USB-to-serial cable.
    Open up USART terminal sa mikroC or sa windows (hyperterminal).
    Make sure the same ang baud rate settings and tsakto sad ang comport.
    Send a character sa terminal. If di nimo ma receive ang imo gi send sa terminal, that means may problem imo hardware.
    Last edited by red_horse; 10-15-2012 at 10:57 PM. Reason: Typo..

  6. #116

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Quote Originally Posted by red_horse View Post
    Dili maka tag-an ana bro since wala man ka gapakita sa imo codes or circuit.
    But there are ways to debug both your hardware and software.

    Let us start sa hardware.
    First do an echo test sa PC side.

    I assume gagamit ka ug ug max232/max3232.
    I-short ang pin11 and pin12 or pin9 and pin10 sa max232/max3232 depende ug asa nimo gi-connect ang USB-to-serial cable.
    Open up USART terminal sa mikroC or sa windows (hyperterminal).
    Make sure the same ang baud rate settings and tsakto sad ang comport.
    Send a character sa terminal. If di nimo ma receive ang imo gi send sa terminal, that means may problem imo hardware.
    Mao ni ako naa sa Proteus circuit Bro @red_horse
    naa ko pangutana unsa nang COMPIM dba mao nang DB9 or USB-to-RS232?



    Mao ni Code nako sa MikroC Pro.
    Code:
    char UART1_Data_Ready();
    char uart_rd;
    void main()
    {
      TRISB=0;
      PORTB=0;
      UART1_Init(9600);               // Initialize UART module at 9600 bps
      Delay_ms(100);                  // Wait for UART module to stabilize
      while(1)
      {
               if(UART1_Data_Ready())
               {
                while(1)
                {
                  uart_rd = UART1_Read();
                  if(uart_rd=='A')
                  {
                   PORTB=0X14;
                   DELAY_ms(5000);
                   PORTB=0X24;
                   DELAY_ms(500);
                   PORTB=0X41;
                   DELAY_ms(5000);
                   PORTB=0X42;
                   DELAY_ms(500);
    
                  }
                  else if(uart_rd=='O')
                  {
                     PORTB=0x00;
                     DELAY_ms(500);
                  }
                  else if(uart_rd=='m')
                  {
                     PORTB=0x41;
                     DELAY_ms(500);
                  }
                  else if(uart_rd=='M')
                  {
                     PORTB=0x14;
                     DELAY_ms(500);
                  }
                }
    
               }
      }
      }
    Kini mao ni ako code sa Visual C#.....

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO.Ports;
    
    namespace SerialPortsNew
    {
        public partial class Form1 : Form
        {
            SerialPort port = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
            bool CurrentState = true;
            bool PrevState;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Automatic_Click(object sender, EventArgs e)
            {
                Manual.Enabled = false;
                off.Enabled = true;
                port.Open();
                port.Write("A");
                port.Close();
            }
    
            private void Manual_Click(object sender, EventArgs e)
            {
                Manual.Visible = false;
                off.Enabled = true;
                Automatic.Enabled = false;
                pressManual.Visible = true;
            }
    
            private void off_Click(object sender, EventArgs e)
            {
                if (CurrentState)
                {
                    Manual.Enabled = true;
                    Automatic.Enabled = true;
                    Manual.Visible = true;
                    pressManual.Visible = false;
                    port.Open();
                    port.Write("O");
                    port.Close();
                    PrevState = false;
                    CurrentState = PrevState;
                }
                else if (PrevState == false && CurrentState == PrevState)
                {
                    Manual.Visible = true;
                    pressManual.Visible = false;
                    Automatic.Enabled = true;
                    port.Open();
                    port.Write("O");
                    port.Close();
                    CurrentState = true;
    
                }
    
            }
    
            private void pressManual_Click(object sender, EventArgs e)
            {
                if (CurrentState)
                {
    
                    port.Open();
                    port.Write("M");
                    port.Close();
                    PrevState = false;
                    CurrentState = PrevState;
                }
                else if (PrevState == false && CurrentState == PrevState)
                {
                    port.Open();
                    port.Write("m");
                    port.Close();
                    CurrentState = true;
    
                }
    
            }
        }
    }
    ahak ani oi deadline nabaya inig Friday..

  7. #117

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Dili nako makita imo proteus file or image.
    Kanang COMPIM mura ra na sya ug serial port with built in max232 inside so direct ra nimo i-connect sa imo mcu.
    I-double click na sya makita nimo ang BaudRate ug ComPort settings.

    Your codes seems ok. Maybe sa hardware lang jud imo problema.

  8. #118

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Deadline na rong monday?
    Actually dugay naman sad ni.
    If kumpleto ka sa hardware mahuman lang ni one day.
    Naa na ba kay max232?
    If wa pa buy nalang sa egizmo ug USB-to-TTL module, which works with 3.3-5v PIC's.
    e-Gizmo USB-UART Serial TTL converter

    Or kana gibaligya ni carl_marx1234.


    By the way taas ra kaau imo delay dri,
    Code:
    if(uart_rd=='A')
                  {
                   PORTB=0X14;
                   DELAY_ms(5000);
                   PORTB=0X24;
                   DELAY_ms(500);
                   PORTB=0X41;
                   DELAY_ms(5000);
                   PORTB=0X42;
                   DELAY_ms(500);
                  }
    If ang imo PIC maka receive sa character "A", mo wait pa sya 11 seconds para mo detect na sad ug lain characters.

  9. #119

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    Quote Originally Posted by red_horse View Post
    Deadline na rong monday?
    Actually dugay naman sad ni.
    If kumpleto ka sa hardware mahuman lang ni one day.
    Naa na ba kay max232?
    If wa pa buy nalang sa egizmo ug USB-to-TTL module, which works with 3.3-5v PIC's.
    e-Gizmo USB-UART Serial TTL converter

    Or kana gibaligya ni carl_marx1234.


    By the way taas ra kaau imo delay dri,
    Code:
    if(uart_rd=='A')
                  {
                   PORTB=0X14;
                   DELAY_ms(5000);
                   PORTB=0X24;
                   DELAY_ms(500);
                   PORTB=0X41;
                   DELAY_ms(5000);
                   PORTB=0X42;
                   DELAY_ms(500);
                  }
    If ang imo PIC maka receive sa character "A", mo wait pa sya 11 seconds para mo detect na sad ug lain characters.
    kini siya kay for Automatic nga button ra ni cya, kay ako gibuhat kay murag traffic light( naa Manual button, ug naa pud Automatic... mao ra..... wala lagi ko kapalit ug max232 mga tag-pila sad kaha ni? naa ni technica?,.. unsa maning USB-to-TTL converter ang ako man project gud kay dapat serial gamiton.....

    Code:
    if(uart_rd=='A')
                  {
                   PORTB=0X14;
                   DELAY_ms(5000);
                   PORTB=0X24;
                   DELAY_ms(500);
                   PORTB=0X41;
                   DELAY_ms(5000);
                   PORTB=0X42;
                   DELAY_ms(500);
                  }

  10. #120

    Default Re: Need help: MikroC/MikroC Pro Compiler + PIC18F4550

    naay gamay sayup ang code nmo sa mikroC bro.
    Nag endless loop ka ug kaduha. Sa 2nd loop nmo wako nkakita ug cndition nga mo terminate cya.
    So never na cya mo read ug usab sa uart.

    Remove d 2nd loop.

    1thing: rs232 is dli ka level sa pic serial. U need to have a voltage leveler ic which is max232.
    Mao ni cya mo convert from rs232 to TTL LEVEL. Kay ttl man pic.

    2 options:
    A. U buy max232 sa teknika ug buy sa cdrking usb to serial cable.
    Construct d crkt naa sa help sa mikroC search lng USART

    B. go to any cellshop and look for DCU11 data cable. Pra na cya sa sony ericson
    Cut d other end. Wire color code
    RED: 5V
    Orange: gnd
    Green: rx
    Blue: tx
    White: nc

    This cable is usb to ttl233 na. So no need na max232 ic.

  11.    Advertisement

Page 12 of 13 FirstFirst ... 2910111213 LastLast

Similar Threads

 
  1. NEED HELP: Suzuki Raider J Pro-Modifications
    By PEDR0 in forum Automotive
    Replies: 21
    Last Post: 07-19-2011, 01:42 PM
  2. Replies: 15
    Last Post: 07-17-2010, 04:58 PM
  3. Need help from the pros..
    By lingkwyz in forum Programming
    Replies: 5
    Last Post: 10-06-2009, 03:55 PM
  4. Need help with XP pro
    By tracktrix in forum Software & Games (Old)
    Replies: 3
    Last Post: 06-20-2007, 11:11 AM
  5. mga WIN xp pros, i need help..:)
    By clarkhkent in forum Computer Hardware
    Replies: 10
    Last Post: 05-17-2006, 12:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top