12f675_fuse_about_to_blow! - Page 7


Closed Thread
Page 7 of 24 FirstFirst ... 3456789101117 ... LastLast
Results 241 to 280 of 929
  1. #241
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    As far as I know, any of the PIC® that work in the PicKit1 do not have hardware serial (UART), so it does not matter. The only exception I can think of is the ADC pins, you may want to save these for sensors, but they will still work for serial.

    Pin 5
    Common, ground, zero rail...
    This must be connected to both devices for any serial to work.

    Pin 2
    Data is sent to the PC via this pin. PIC® -->> PC

    Pin 3
    Data is sent to the PIC® via this pin. PIC® <<-- PC
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    I'm using a PIC12F683 on my PICKit1.

    I've got common pin5 on the DB9 cable (yellow) going to VSS PIC pin8.

    I've got pin3 on the DB9 cable (red) going to GPIO.0 PIC pin7.

    And pin2 on the DB9 cable (brown) going to GPIO.2 PIC pin5.

    All via header J3.

    How does that sound?

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Sounds like it should work.
    Is there any analog on those pins? No problem, just turn it off and give it a go.

    Maybe you already know it, MCS has a nice terminal program built in.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Yes there is analog AN0/1/2

    So turn the ANSEL & CMCON0 off.

    MCS has a nice terminal program built in.
    Is this Microsoft Hyperterminal?

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


    Did you find this post helpful? Yes | No

    Default

    Yup, turn them off

    Not hyperterminal. MCS - View - Serial communicator.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Mmm

    I've got a headache.

    So we've got one transmit and one receive line to and from the PIC set up.So do I write a program so that when data from the pc arrives (if it ever does) at GPIO.0 an led toggles.

    Would that be a good starting point?

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    You have a headache... I am stuck in an "art gallery" for the next few hours.

    Yes, pick a baud say of 2400 , can not remember the mode number.

    SERIN2 PIN, BAUD,[MYVAR]
    IF MYVAR = ??? THEN

    Something like that....
    I will be back atthe shop later.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    I am stuck in an "art gallery" for the next few hours.
    Strange places 'art galleries' me and my wife visited one years ago and the man from behind the counter came over and said "Would you model for me" to which my wife said (after a pause I might add) " No I couldn't " to which he said " I wasn't talking to you! " And no I didn't either by the way.

    Is this anywhere near where I should be heading?

    Code:
    MYVAR  VAR BYTE 
    
    serin2 GPIO.0, 2400,["MYVAR = ", BIN MYVAR, 10]     
    
    IF MYVAR = %00001010 THEN HIGH GPIO.5
    Also, the Port (com1) settings are: 9600 bps 8N1. Do I need to change that to 2400?

    Dave
    Last edited by LEDave; - 10th April 2010 at 15:18.

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


    Did you find this post helpful? Yes | No

    Default

    I've been looking for 'Serial Communicator' in MicroCode_Studio and all I can find is this:

    The Serial Communicator enables you to connect to and monitor a serial port. For more information, see the online help provided with the Serial Communicator software.
    I've also been to the MCS website, still no luck.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Lets say you are sending "3" from the PC
    Code:
    MYVAR  VAR BYTE 
    
    serin2 GPIO.0, 2400,[DEC MYVAR]     
    
    IF MYVAR = 3 THEN HIGH GPIO.5
    Also, the Port (com1) settings are: 9600 bps 8N1. Do I need to change that to 2400?
    You will do that in the terminal program.
    Attached Images Attached Images  
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Cheers mackrackit, your time and effort appreciated as ever.

    Another LEDave question though. Does the 'serial communicator' have to be installed on both machines? Or can I configure Com Port1 (on the old pc) through the DELL.

    Dave
    Last edited by LEDave; - 10th April 2010 at 17:03.

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


    Did you find this post helpful? Yes | No

    Default

    Not sure I understand that one.
    Instal MCS on both machines. I think ?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Instal MCS on both machines
    Yes, does MCS need to be on both machines to make this work, or can the communicator be set up / work over a network.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    You will need MCS on the machine that you are writing code/ programing the PIC on and also on the machine you are going to use for the serial comunication.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Cheers,

    I'll load it up.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    I loaded the program and setting is : com1 : 2400baud : No parity :byte size 8 : 1 stop bit.

    I typed 3 into the transmit window (it shows a flashing green connected bottom left hand side of screen) and at the bottom middle is says bytes TX: 1 : bytes RX:0

    After a while though it suddenly said: TX: 1 RX: 330 and a row of 'yyyyyy's in the received box.

    I've tried it several times since though and back to: TX1 RX:0

    So nearly there? Very exciting though I must say.I feel like Marconi....

    Also the LED's on GPIO.5 didn't light up.
    Last edited by LEDave; - 10th April 2010 at 22:18.

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


    Did you find this post helpful? Yes | No

    Default

    Marconi??????
    Tesla!!!

    If you do not figure it out in a bit. Post the configs/code and tell us again how everything is connected.

    Being that it returned something once makes me think something might be loose.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Being that it returned something once makes me think something might be loose
    Well it could be. Although I've just realised that it only posted the 'yyyyy's when I reloaded the program.

    Speaking of program, could that be the problem (don't forget I'm still the worst programmer in the Northern hemisphere right now)

    Code:
    CMCON0 = %00000111 
    ANSEL = %00000000 
    TRISIO = %00000000 
    GPIO = %00000000
     
    DEFINE SER2_BITS 8
    
    MYVAR  VAR BYTE 
     
    MAIN
    
    serin2 GPIO.0, 2400,[DEC MYVAR] 
    
    IF MYVAR = 3 THEN HIGH GPIO.5
    Tesla_Dave

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


    Did you find this post helpful? Yes | No

    Default

    Hint...
    Code:
    serin2 GPIO.0, 2400,[DEC MYVAR]
    Take another look at the manual and appendix B , I think it is B, MODE number.

    Then add a short pause maybe 1/4 second, and a GOTO MAIN

    MAIN:
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    I've tried this but it doesn't compile, do I need the 2400baud as well?

    serin2 GPIO.0, Mode = 396, [DEC MYVAR]
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    I've tried this but it doesn't compile, do I need the 2400baud as well?

    Code:
    serin2 GPIO.0, Mode = 396, [DEC MYVAR]

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


    Did you find this post helpful? Yes | No

    Default

    From the manual
    ' Wait until the character “A” is received serially on Pin1 and put next character into B0
    SERIN2 1,16780,[wait (“A”),B0]

    ' Skip 2 chars and grab a 4 digit decimal number
    SERIN2 PORTA.1,84,[skip 2,dec4 B0]

    SERIN2 PORTA.1\PORTA.0,84,100,tlabel,[wait (“x”, b0), str ar]
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    This was my last go for tonight (wouldn't compile though).

    I'm going to sleep on it.

    Cheers again mackrackit, see you tomorrow.

    Code:
    CMCON0 = %00000111 
    ANSEL = %00000000 
    TRISIO = %00000000 
    GPIO = %00000000
     
    DEFINE SER2_BITS 8
    
    con mode = 396
    
    MYVAR  VAR BYTE 
     
    MAIN
    
    serin2 GPIO.0, 2400,mode, [DEC MYVAR]
    
    IF MYVAR = 3 THEN HIGH GPIO.5
    PAUSE 250
    GOTO MAIN
    Tesla_Dave

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


    Did you find this post helpful? Yes | No

    Default

    Might be another problem...

    If all of the PicKIt1 are the same, mine has GPIO.0 connected to the on-board POT (RP1).

    Your code is still a bit off, but code will not fix hardware.

    Maybe I am looking at the hardware wrong, exactly what do you have? Maybe a picture?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    I've re-cheched my connections:

    PIC12F683 on my PICKit1.

    I've got common pin5 on the DB9 cable (yellow) going to VSS PIC pin8.

    I've got pin3 on the DB9 cable (red) going to GPIO.0 PIC pin7.

    And pin2 on the DB9 cable (brown) going to GPIO.2 PIC pin5.


    Pin 5
    Common, ground, zero rail...
    This must be connected to both devices for any serial to work.

    Pin 2
    Data is sent to the PC via this pin. PIC® -->> PC

    Pin 3
    Data is sent to the PIC® via this pin. PIC® <<-- PC
    So data is coming from the pc onto GPIO.0

    data is going from the PIC to pc on GPIO.2

    How does that look / sound?

    Dave
    Last edited by LEDave; - 11th April 2010 at 18:58.

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


    Did you find this post helpful? Yes | No

    Default

    I've added 'modedefs.bas' and set mode '0' still no joy

    Code:
     CMCON0 = %00000111 
    ANSEL = %00000000 
    TRISIO = %00000000 
    GPIO = %00000000
     
    DEFINE SER2_BITS 8
    
    INCLUDE "modedefs.bas"
    
    MYVAR  VAR BYTE 
     
    MAIN
    
    pause250
    
    serin2 GPIO.0, 0, [DEC MYVAR]
    
    IF MYVAR = 3 THEN HIGH GPIO.5
    PAUSE 250
    GOTO MAIN

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    CMCON0 = %00000111 
    ANSEL = %00000000 
    TRISIO = %00000000 
    GPIO = %00000000
    
    MYVAR  VAR BYTE 
     
    MAIN:
    PAUSE 250
    SERIN2 GPIO.0, 16780, [DEC MYVAR] '2400 INVERTED
    IF MYVAR = 3 THEN HIGH GPIO.5
    PAUSE 250
    GOTO MAIN
    But if GPIO.0 is connected to the POT it may not work.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit

    I've metered GPIO.0 out to the pot, it does seem to be connected(getting some strange readings though).

    I then changed the cable from GPIO.0 to GPIO.4 (and the program to reflect the change) when I send from the serial communicator two LED's briefly flash on then off ( pretty quick though).

    I increased the pause time from 250 to 2000, still only a brief flash but definately
    flashing!

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Two LEDs ???

    GPIO.4 is connected to a LED ?

    If you have a 14 pin chip try it. I think some of the pins from a 14 will go directly to the J3 header.

    Making progress though!!!
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit

    Was getting there, I say was because every time I try and load a program now 'checksum verify failed' appears.Any ideas on that one.

    Dave
    Last edited by LEDave; - 11th April 2010 at 21:34.

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


    Did you find this post helpful? Yes | No

    Default

    Disconnect the serial cable from the PC?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Disconnect the serial cable from the PC?
    Cured 10-10 mackrackit

    I'll change chips in a mo'

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    GPIO.0 and 1 are programming pins.

    At times they need isolated when squirting the code into the chip.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Here's the latest code, doesn't work though

    Is it ok to leave the PIC - pc cable unplugged? If not where should it go?

    The PIC is a 16F684

    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 
     
    MAIN:
    PAUSE 250
    SERIN2 PORTA.0, 16780, [DEC MYVAR] '2400 INVERTED
    IF MYVAR = 3 THEN HIGH PORTA.5
    PAUSE 250
    GOTO MAIN
    Dave
    Last edited by LEDave; - 11th April 2010 at 22:36.

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


    Did you find this post helpful? Yes | No

    Default

    Try changing the wire from the PC, pin 2 on the DB9 to PORTC.4. I think it goes directly to the J3 header.

    PORTA.0 is still going through the POT and is a programming pin.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Try changing the wire from the PC, pin 2 on the DB9 to PORTC.4. I think it goes directly to the J3 header.
    Getting confused here, I thought data was sent to the PC via pin 2?

    Pin 2
    Data is sent to the PC via this pin. PIC® -->> PC

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


    Did you find this post helpful? Yes | No

    Default

    OOPPPSSS!!!!!!!

    I goofed.

    Sorry.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    OOPPPSSS!!!!!!! I goofed. Sorry.
    Hey even Marconi got his wires crossed from time to time I'm sure

    I've got the red wire from pc (pin3 db9) going to PORTC.5 (fourth one down on the jumper).

    Here's the latest prog:

    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 
     
    MAIN:
    PAUSE 250
    SERIN2 PORTC.5, 16780, [DEC MYVAR] '2400 INVERTED
    IF MYVAR = 3 THEN HIGH PORTA.5
    PAUSE 250
    GOTO MAIN
    Last edited by LEDave; - 11th April 2010 at 23:27.

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


    Did you find this post helpful? Yes | No

    Default

    That chip defaults to 4 MHz so you will want to add

    DEFINE OSC 4
    to the beginning of your code.

    Make sure you can blink an LED at an expected rate.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hey mackrackit, I think we've cracked it

    Instead of just sending a '3' over from the transmit box which didn't work, I changed it to 'DEC:3' clicked send and the LED's lit for 5 seconds then went off as per the program below. Is that what I should type, DEC:1-9 or should it work on just sending '3'

    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 
     
    MAIN:
    PAUSE 250
    SERIN2 PORTC.5, 16780, [DEC MYVAR] '2400 INVERTED
    IF MYVAR = 3 THEN HIGH PORTA.5
    PAUSE 5000
    low PORTA.5
    GOTO MAIN

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