12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    The serial data transfer is working a treat

    Before we move on a couple of quick questions I'm a little confused on.

    1/ 16780. This is the MODE for inverted 2400 baud right?

    2/ The 'inverted' baud. Is that just keeping the transmit voltage level from pc - PIC at TTL levels 0 and +5v, instead of + or - 12v as used it RS232?

    Right then what's next (I've got a spare brown wire here just itching to send something out of my PIC)
    Last edited by LEDave; - 12th April 2010 at 21:27.

  2. #2
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Would this work to send '4' out on PORTC.3 when '3' comes in from the pc.

    Code:
    ANSEL   = %00000000    'Disable analog select so ports work as digital i/o.
    CMCON0  = %00000111    'Disable analog comparators.
    TRISA   = %00000000    'Set PORTA as OUTPUT.
    PORTA   = %00000000    'Set PORTA pins all low.
    TRISC   = %00000000    'Set PORTC as OUTPUT.
    PORTC   = %00000000    'Set PORTC pins all low.
    
    MYVAR  VAR BYTE 
    
    DATA_OUT CON 4 
     
    MAIN:
    PAUSE 250
    SERIN2 PORTC.5, 16780, [DEC MYVAR] '2400 INVERTED
    IF MYVAR = 3 THEN HIGH PORTA.5
    PAUSE 5000
    LOW PORTA.5
    PAUSE 250
    SEROUT2 PORTC.3, 16780, [DEC DATA_OUT]
    PAUSE 5000
    GOTO MAIN
    Last edited by LEDave; - 12th April 2010 at 22:23.

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


    Did you find this post helpful? Yes | No

    Default

    1/ 16780. This is the MODE for inverted 2400 baud right?
    Correct
    2/ The 'inverted' baud. Is that just keeping the transmit voltage level from pc - PIC at TTL levels 0 and +5v, instead of + or - 12v as used it RS232?
    Nope, inverted means 1 is 0 and 0 is 1.
    It is still 0 to +5.

    What I can see of your code on my phone it looks like it should work.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Smile

    What I can see of your code on my phone it looks like it should work.
    And you were right mackrackit

    '3' came in from the pc and '4' arrived on the pc, brilliant!

    Where to next? send some text?

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    You can send some text.

    And.....

    Now would be a good time to play with the SERIN2/SEROUT2 modifiers.
    Data can be formatted several ways, HEX, BIN, DEC, ASC||, STRings...

    Might be something sorta fun... Send a number to the PIC® say in DECimal format and have the PIC® return the number in other formats. Play with every combination you can think of. This should give you an understanding how different number systems work with this system.

    Could even send a couple of numbers and have an operation done on them and the results sent back to the PC.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I'm on it.

    Could take a day or two (or three) though. One or two 'holes' to plug in LEDave's knowledge base, bear with me.

    As an aside here, is it just me or is there something 'magical' 'mystical' even about all this? You've a little black 'spider' with 14 legs and three wires attached and numbers appearing on a monitor at the press of a button, I love it.

    Must dash, work, work, work and a lot of reading to do.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LEDave View Post
    As an aside here, is it just me or is there something 'magical' 'mystical' even about all this? You've a little black 'spider' with 14 legs and three wires attached and numbers appearing on a monitor at the press of a button, I love it.
    Kind of like science fiction.
    Dave
    Always wear safety glasses while programming.

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