Using PICs as UARTs


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: Using PICs as UARTs

    Quote Originally Posted by dhouston View Post
    the boards will be assembled in China.
    What are the flaws in my hare-brained scheme?
    You have answered you own question.

    I have no opinion about the fesability of your design, but from what I have seen here from your other posts, I am sure it will be great.

    [soapbox]
    Don't get me wrong, I buy imported stuff all the time, but as a small shop, I know all too well the impact of sending our manufacturing overseas. I was even coerced into trying this myself. It did not pay off in the short run, and will never pay off in the long run. IMHO

    When we send the "gravy" work out, the manufactures here have to rely more on prototype stuff to pay the bills. So then we have to pay more for the proto work.
    [/soapbox]
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Aug 2011
    Posts
    455

    Default Re: Using PICs as UARTs

    If you don't mind setting a unique ID in the UserID area when you initially program the chip (say 1 to 4 for example), then you could use this setting to identify which of the four uarts the chip is supposed to be and have the master use the General Call address feature of the I2C to assign a new address to the device at powerup. It could be as simple as sending a packet to the General Call address consisting of the ID number and the new address.

    No additional lines required.

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166

    Default Re: Using PICs as UARTs

    dhouston, Doensn't the pic have an A/D? With a couple of fixed 1% resistors you can have quite a few addresses...
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: Using PICs as UARTs

    Quote Originally Posted by Dave View Post
    dhouston, Doensn't the pic have an A/D? With a couple of fixed 1% resistors you can have quite a few addresses...
    Dave - I had thought of that but I am using the hardware EUSART and the hardware I2C so the only free pin is the MCLR pin which is input only - no ADC.

    But, see my answers above - the availability of the ds30 Bootloader for the chips I'm planning to use solves my problem.

  5. #5
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: Using PICs as UARTs

    Quote Originally Posted by tumbleweed View Post
    If you don't mind setting a unique ID in the UserID area when you initially program the chip (say 1 to 4 for example), then you could use this setting to identify which of the four uarts the chip is supposed to be and have the master use the General Call address feature of the I2C to assign a new address to the device at powerup. It could be as simple as sending a packet to the General Call address consisting of the ID number and the new address.
    I guess I did not explain my concerns clearly.

    Microchip will preprogram chips when you order them. All four chips will be have identical firmware except for the I2C address which must relate to a physical port (S2-S5) which is, in turn, related to the physical location of each chip on the PCB.

    The logistics of keeping 4 separate chips separate and then assembling them to the correct PCB location is what scares me. On another board, I have two sets of two identical chips (2x12F1822, 2x16F1823), that ID themselves upon startup by the state of one input which is grounded for one socket and tied high for the other - and these are DIP chips with sockets so it's not as critical that they be assembled correctly. I was trying to find a way to extend that to handle four identical chips.

    However, the issue is now moot. The ds30 bootloader has been updated to support all three PICs I am using (12F1822, 16F1823, 12F1840) and it allows writing EEPROM so they can have the bootloader installed by Microchip and then be programmed over a serial link after assembly or even by the end user.

  6. #6
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: Using PICs as UARTs

    Quote Originally Posted by cncmachineguy View Post
    You have answered you own question.
    First, the decision to have the boards made in China is not mine but the distributor's (who is helping fund the development).

    Second, were it my decision, they would still be made in China. It's the difference between having something that can be sold at a competitive price and having something that cost 5x the market retail price with no hope of selling any. The Arduino market has thousands of boards available selling for $10-50 depending on whether bare, kits, assembled and on what's onboard. The last time I looked at US assembly was about 10 years ago - the president of the company was a friend - the quote was about 10x what I could get them for from China.

    Third, I spend about 20 years in the machine tool industry culminating in my running the US operations for a (small) multinational builder of machine tools so I empathize with your position but, it's about 30 years too late. The Reagan administration decimated the US machine tool industry and it's not likely to ever recover. (ASIDE: One of my customers made programmable machines that assembled through-hole components onto PCBs - I never dreamed I might want one thirty years later.)

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