16F877A to 18F4550 comms


Closed Thread
Results 1 to 6 of 6
  1. #1

    Default 16F877A to 18F4550 comms

    i'm thinking of splitting my pulse motor conrtol system between two PIC's
    4550 @ 48MHz for fast reaction to an analogue input...
    877A to do all the Maths and various analogue lines for the automatic tune program.

    The only things that the 4550 needs to send to the 877A would be two bytes for RPM and / or one byte for certain statuses, so 1 byte for DATA ID/status and an optional two bytes if it's RPM

    The 877A will send 1byte as DATA ID/status and an optional 2 bytes if it's changing one of the tune varables...

    I want to use onboard hardware comms due to lower overheads in software...
    I was going to use USART @ 115K but then i realised that the USART doesn't have flow control lines...
    So I looked at the MSSP in SPI mode... it doesn't have flow control ether...

    I looked at PSP, but i'm not sure i'll have enough IO lines on the 877A with using an LCD too...is the RD, WR and CS flow control? Whats it speed? whats its buffering?

    Whats everyones opinion on the best method?

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


    Did you find this post helpful? Yes | No

    Default

    I think I would use an interrupt with the USART and not worry about flow control.

    EDIT:
    Now I see on another post that you do not want to use interrupts... Why??
    Last edited by mackrackit; - 3rd October 2009 at 22:08. Reason: Saw other post
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    two reasons, i'm using PBP244 at this moment and acording to the manual their are two ways of doing interupts...
    in PBP using ONINTERUPT which then causes latency in the program...

    The other is in assembler and every time i read it i get a headach and don't understand it... It's alien compaired to what i'm used to...

    I do plan to buy the pbp260 upgrade in 2-3 weeks... perhaps that will help

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


    Did you find this post helpful? Yes | No

    Default

    I can not remember if DTs Instants work with PBP244, might take a look at it.

    If I understand what you are doing tou would only need the interrupt on the 4550. When the 877A needs data the routine that called for it could wait there for a response, maybe for X time. If the 4550 is not doing much maybe on-interrupt would not be to slow.

    Just thoughts....
    Dave
    Always wear safety glasses while programming.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    the 4550 basically has a loop...
    read ADC1
    if ADC1 is over the on trigger variable then turn on B1
    If ADC1 is lower than off trigger var then turn off B1

    For every time B1 is turned on increment pulse count var

    If pulse count var = 4 read tmr1 and calculate RPM
    Reset TMR1 and restart loop

    The faster the cycle the better...

    The addition would be to recieve a new ON and OFF trigger var from the 877A
    The single byte 'commands' comming from the 877a are...
    * Stall warning - return to predefined static settings
    * Overspeed1 - stop pulsing
    * Overspeed2 - engage emergency break (relay on B2)

    The 877a will only be changing one var every 5 seconds or so...

    The 877a will be doing all the work and the calculations and putting data on the LCD...

    I don't know 'DTs instants' i'm guessing i go do a search for it... lol

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


    Did you find this post helpful? Yes | No

    Default

    I am sure you found it but if not
    http://www.picbasic.co.uk/forum/showthread.php?t=3251
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. 16f877A V 18F4550
    By comwarrior in forum General
    Replies: 3
    Last Post: - 21st October 2009, 20:34
  2. 16F877 vs. 16F877A
    By DavyJones in forum General
    Replies: 12
    Last Post: - 11th April 2009, 19:22
  3. 18F4550 to 18F2550
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th September 2007, 00:13
  4. How can I turn off USB support in 18F4550
    By BrianT in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2007, 04:56
  5. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 19:52

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