12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

  1. #1
    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.

  2. #2
    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

  3. #3
    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.

  4. #4
    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

  5. #5
    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.

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


    Did you find this post helpful? Yes | No

    Default

    Kind of like science fiction.
    Exactly,even stranger though!

    Here's tonight's effort, it works up to DEC255 then ouputs a zero for 256 etc, which is larger than a BYTE I'm thinking.

    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.
    
    DEFINE OSC 4
    
    MYVAR  VAR BYTE 
     
    MAIN:
    PAUSE 250
    SERIN2 PORTC.5, 16780, [DEC MYVAR] 'MODE 16780 = 2400 BAUD INVERTED 
    IF MYVAR = MYVAR THEN HIGH PORTA.5 'LET'S YOU INPUT ANY NUMBER.
    PAUSE 5000
    low PORTA.5
    pause 250
    SEROUT2 PORTC.3, 16780, [HEX MYVAR, 10, 13] 'OUTPUT IN HEX 'MYVAR' 10=L_FEED 13=C_RETURN
    pause 5000
    GOTO MAIN
    Last edited by LEDave; - 13th April 2010 at 20:02.

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


    Did you find this post helpful? Yes | No

    Default

    From the second part of the brief:

    Could even send a couple of numbers and have an operation done on them and the results sent back to the PC.
    Hmm, a little stumped here. To my mind (after a lot of reading but obviously not enough!) when the first BYTE (number) arrives I need to send it to a memory location where it won't be overwritten when the second BYTE arrives.Then add the two together.

    The only thing I've found so far that has a seperate address element is this (I think):

    Code:
     Label VAR Size[Number of elements]
    I'm thinking: MYVAR VAR BYTE [1] which is two elements 0,1. then somehow add element 0 to element1.

    Warm or way off?

    Dave

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