Idea of master/slave serial comm.


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108

    Default Idea of master/slave serial comm.

    Hello ... I'm about to work on a project that needs an interface by software. I'll use PIC16F676 and before I start doing things, I was trying to get the idea of how to make PIC and PC send information to each other at the same time..

    So, in a basic system, let's say a got a PWM in a Pin1, a Sensor in Pin2 and Serial Comm. in Pin3, Pin4.

    I would like to send the value of the AD of the Sensor to the PC continuously and also receive from PC values of the PWM that will be applied in Pin1. But, without HPWM, how can this be possible? I'm asking that because the PWM Pin is connected to a CC motor and it must be ON all the time.

    So, and the question are.

    Is it possible to use a VAR in PWM command?
    How would be the SERIN and SEROUT commands (because PIC needs to say and listen all the time)

    Please, I'm not asking the codes, only some idea... (but if there is a code, it would be great, )...

    Thanks in advance..

    Sylvio
    Sylvio,

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,809


    Did you find this post helpful? Yes | No

    Default

    1. I would not do it without USART or HPWM.

    2. When you choose an appropriate PIC chip, consider using Interrupts. Have a look at Darrel's Instant Interrupt (here or at his site www.pbpgroup.com)

    Ioannis

  3. #3
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sirvo View Post
    But, without HPWM, how can this be possible? I'm asking that because the PWM Pin is connected to a CC motor and it must be ON all the time.
    If things are happening fast enough it's possible without HPWM or USART. Certainly not ideal though nowadays, but if you can do it without them, you lend the project to be able to utilize some of the smaller & cheaper controllers that don't have HPWM & USART available.

    How do you think the Z80 & 8086 controllers managed to do stuff like this? (All software-based)

  4. #4
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    I've just bought a brand new 16f877.

    I used HPWM and Usart and everything is working excelent.. and also used visual basic to control de motor and so..

    Thanks again..

    Regards.
    Sylvio,

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,809


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    How do you think the Z80 & 8086 controllers managed to do stuff like this? (All software-based)
    Didn't they rely on external chips for USARTS, PIO, RTC etc?

    I still remember the 8251 (UART), 8253 (Counter-Timer) and 8255 (PIO) chips! Good old times!

    Ioannis

Similar Threads

  1. Serial comm between two PICs
    By ALFRED in forum Serial
    Replies: 24
    Last Post: - 13th March 2014, 23:22
  2. serial comm to C328 camera module
    By mxkeene in forum Serial
    Replies: 2
    Last Post: - 28th November 2007, 21:21
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. 16F877, DS18S20 and Serial Comm Problem
    By YellowTang in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2004, 10:36
  5. serial comm from Pic to STAMP
    By d1camero in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th April 2004, 23:58

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