1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Junebug Assembly Tips

Discussion in 'Microcontrollers' started by Krumlink, Nov 5, 2007.

  1. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    OctaPart: JuneBug Parts

    These are the parts numbers for JuneBug
    So far I have switches and Semiconductors.
    Added the inductor L1 and the USB connector CON1
    I did not include the LEDs.

    Octapart shows the supplier part numbers prices from several popular suppliers.

    It would be nice if there was a way to change the order of parts in the list.

    If you hit buy at the bottom of the page it will help you find the best deal
    On the buy page it shows you each supplier and their price.
    You can check the boxes Price Minimize In Stock and it will sellect the suppliers with the lowest price for in stock items.
    You can then manualy reselect suppliers as you wish.
    I have never tried ordering from this page.

    Let me know if you like it. Is it worth finishing ?
     
    Last edited: Nov 11, 2007
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    It's very handy 3v0 I could add to the parts list. I've used Omron switches both small and large.

    PS here's a quick test for Mongoose
    Code (text):
    ; Mongoose Hello World, right motor speed set by VR1
    ; jumper a small wire between VR1 and RA0 on the top connector      
             list     p=18F2525
             include <p18F2525.inc>
             CONFIG   OSC = INTIO67, PBADEN = OFF, WDT = OFF, LVP = OFF, DEBUG = ON
             
             org      0
             bsf      ADCON0,ADON
             clrf     LATB
             movlw    0xF0              ; RB0-3 motor direction outputs
             movwf    TRISB             ; RB4,5 optosensor inputs
             movlw    b'11111001'      
             movwf    TRISC             ; RC1,2 PWM outputs
             movlw    0x0F
             movwf    ADCON1            ; AD/RC Osc
             movwf    CCP1CON           ; PWM mode
             movwf    CCP2CON        
             setf     PR2               ; PR2 = 255
             movlw    0x80              ; 50% PWM
             movwf    CCPR1L            ; left motor speed
             movwf    CCPR2L            ; right motor speed
             movlw    b'00000011'
             movwf    LATB              ; motor direction
             bsf      T2CON,TMR2ON      ; enable TIMER2
    AD_GO    bsf      ADCON0,GO         ; start conversion
             btfsc    ADCON0,GO
             bra      $-2
             movff    ADRESH, CCPR1L  
             bra      AD_GO
             
        END
     
    Last edited: Nov 11, 2007
  3. jeremygaughan

    jeremygaughan New Member

    Joined:
    Sep 26, 2007
    Messages:
    129
    Likes:
    1
    Location:
    Hot Springs, AR
    I'm also building along at home, but I can't seem to track down the P-channel mosfet. Actually I can't seem to get a hold of any P-channel mosfet. So I have two questions, is there a way around that part, and if not is it necessary for programming?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada

    The BS250 is only required for VPP before VDD programming. Just connect the Source to Drain connections and omit it (and the 2N7000 just don't install it)
     
  6. jeremygaughan

    jeremygaughan New Member

    Joined:
    Sep 26, 2007
    Messages:
    129
    Likes:
    1
    Location:
    Hot Springs, AR
    Thanks for the quick help, I'll leave the place on my board for when I get back to the US and can get the part, but until that time I'll follow your advice. Another question that I have is, I get a verify problem with the 18F2550. It says "EEPROM error at 0x0000 good 0xFF bad 0x9E. Any idea what that could mean or be due to?
     
  7. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    What are you using to program the 18F2550?
     
  8. jeremygaughan

    jeremygaughan New Member

    Joined:
    Sep 26, 2007
    Messages:
    129
    Likes:
    1
    Location:
    Hot Springs, AR
    I'm using a kit149 BE. I read the 18f2550 after programming and the hex looks exactly like the hex I was trying to put into it. Should there be any info in the EEPROM? I'm going to continue with my build and put a few pictures in a little while.
     
  9. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    It uses the eeprom but I don't think having it unprogrammed is a problem. The PICkit 2 standalone software will let you calibrate and name your PK2 / Junebug.
     
  10. jeremygaughan

    jeremygaughan New Member

    Joined:
    Sep 26, 2007
    Messages:
    129
    Likes:
    1
    Location:
    Hot Springs, AR
    Almost done with it. My clone is probably the ugliest programmer ever.:) I'm gonna call it jumper. When you see the pictures you'll understand. Thanks for all the help
     
  11. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Well just for the record here's my prototype. I used a 18F4550 because I had one handy at the time. Still works too!
    [​IMG]
     
  12. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    I made a partial parts list with Digikey "ND" numbers. Maybe it will help someone. I only put in the numbers of what I ordered. The rest came out of my parts boxes:
    Code (text):
    Parts List JUNEBUG

    Capacitors
    1  C1      22uF 16V (must be at least 16V rated)
    2  C2,3    22pF ceramic (18pF thru 22pF acceptable) (495-3298-1-ND)
    2  C4,8    0.1uF
    1  C5      100uF (47uF or greater acceptable)
    1  C6      0.47uF (0.22uF thru 0.47uF acceptable) (445-3850-ND)
    1  C7      22uF  (4.7uF thru 47uF acceptable)
     
    Resistors ¼W  
    1  R1      10K  x 5  SIP 10pin 5 independent resistors (4610X-2-103LF-ND)
    1  R2      100  x 5  SIP 10pin 5 independent resistors (4610X-2-101LF-ND)
    1  R3      4.7K x 5  SIP 10pin 5 independent resistors (4610X-2-472LF-ND)
    1  R4,5,10    1K   Brown,  Black,  Red,  Gold
    1  R6    2.7K   Red,  Yellow,  Red,  Gold
    1  R7    100K   Brown,  Black,  Yellow,  Gold
    4  R8,13,14,17    330    Orange, Orange, Brown, Gold
    3  R9,11,12    100    Brown, Black, Brown, Gold
    2  R15,16    22K   Red,  Red,  Orange,  Gold
    2  VR1,VR2    10K   10K  Trimmer  potentiometers

    Semiconductors  
    2  D1,3      1N4148 Small Signal Diode
    1  D2    1N5817  Schottky  Diode (1N5817-TPCT-ND)
    6  LED1,2,3,4,5,6    3mm or 5mm RED or GREEN LED
    1  LED7    3mm  GREEN  LED
    1  LED8    3mm  YELLOW  LED
    1  LED9    3mm  RED  LED
    1  IR1      TSOP34838 38KHz IR detector
    1  Q1,3,6     2N3904 NPN (EBC)  
    1  Q4    2N3906  PNP  (EBC)
    1  Q5    2N7000 N-Channel 200ma MOSFET (2N7000FS-ND)
    1  Q2    BS250P P-Channel 230ma MOSFET (BS250P-ND)
    1  U1    PIC18F2550 (firmware) (PIC18F2550-I/SP-ND)
    1  U2    PIC18F1320 (Tutor) (PIC18F1320-I/P-ND)
    1  Y1    20MHz Crystal (631-111-ND)

    Switches
    3  SW1,2,3   Pushbutton (450-1131-ND)  
    2  SW4,5    Small pushbutton (450-1173-ND ***Discontinued Part***)
    1  SW6      DIP Switch 8 position (GH7176-ND)

    Connectors
    1  CON1    RA USB B connector  
    1  CON2    ICD 2x5 PCB Male   ICD2 (MHC10K-ND)
    1  CON4    3pin  machine  socket  RA3,RA4,GND
    1  CON7    3pin  header   RB3,+5V,GND  
    1  CON8    8pin Molex connector   +5V,RA1,RA2,RA3,RA4,RB1/TX,RB4/RX,GND
    1  CON6    16pin header for 18F2550 (pins 11 thru 16 are PICkit2 compatible)  
    (RE5,U5V,GND,RB7,RB6,RB1,RB0,RC7,RC6,RC2,VPP,+5V,GND,PGD,PGC,AUX)
    1  SOCKET  IC Socket 28POS (ED3328-ND)
    1  SOCKET  IC Socket 18POS (ED3318-ND)

    Miscellaneous
    1  FB1    Ferrite  Bead
    1  L1    680uH  inductor (M8047-ND)

    Optional Accessories
    1  Enclosure    Polyview LAB-EASY BT-04
    Sparkfun Electronics has female breakaway headers for CON6.
     
    Last edited: Nov 12, 2007
  13. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Nice work, both 3v0 and futz you have done a nice job. The CON6 connector is completely optional. It was designed for using the Junebug as an USB experimentor platform, programming EEPROMs, ICP, PK2 compatible connector (with AUX).

    Thanks for pointing out Y1 was not in the BOM.
     
  14. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    I will use futz's (love that name) work to improve the Octopart list.

    It is a bit awkard but they are working on improving the interface to allow us to sort/order the parts and do parameteric searches.

    If all goes well one should be able to generate an order for parts using one or more vendors from the Octopart interface.
     
    Last edited: Nov 12, 2007
  15. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Hehehe! Here's the definition:

    futz f&ts v.i. To tinker experimentally; to change something just to see what it does.
     
  16. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    So, all this time I've been Futzing around and didn't realise.:D

    Mike.
    P.S. I'm going to populate my board tomorrow but I'm having the same problem of getting a p channel fet. Looks like I'll have to take a trip into the city.
     
  17. Krumlink

    Krumlink New Member

    Joined:
    Aug 10, 2007
    Messages:
    2,080
    Likes:
    20
    Location:
    Michigan, USA
    3v0 helped me out a ton today! :D

    He helped me program the 18F1320 to just blink port RB2. He then taught me about the port bits and how to use them. I then kept experimenting with them, changing the timing, and then I ended up with a Binary counter! It counts all the way up to 9, then goes back to 0. I was wondering how I add more bits and ports, such as making the timing go past 9. I couldn't figure this out, and I know you know. Thanks :D

    I LOVE MICROCONTROLLERS! THERE I SAID IT! :D
     
  18. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Impressive, you'll have to post some code.

    The 18F1320 is an advanced 8bit PIC, I actually enjoy using them over the 16F chips. The original Junebug design was going to use another 16F88 but since you can still use the Firefly Tutor I chose to use the 18F1320 on Junebug. *the 18F1320 shows its age by having an open collector RA4*

    Very little bank switching, the LAT instruction, a proper subtract instruction, compare instructions, PUSH, POP, tables, free C compiler. The only drawback is you might not want to work with the 12bit or 14bit cores.

    Not officially announced but I'm testing a simple hardware mod to the Inchworm+ design for 3.3V programming. Basically changed the 330 ohm resistors to 2.4K on the PGC & PFD lines, remove the VDD switch and BS250 (will not power the target) and dropping VPP to 10V (jumper to VPP switch)
     
    Last edited: Nov 12, 2007
  19. Krumlink

    Krumlink New Member

    Joined:
    Aug 10, 2007
    Messages:
    2,080
    Likes:
    20
    Location:
    Michigan, USA
    HEX! That was my problem.

    Here is the code. The bottom portion was what I did:
    Code (text):
    #include <p18f1320.h>
    #include <delays.h>
    #include <stdio.h>
    #include <stdlib.h>

    #pragma config WDT = OFF
    #pragma config OSC = INTIO2
    #pragma config LVP = OFF
    #pragma config PWRT = ON


    // define TESTS
    #define byte unsigned char
    #define int8 unsigned char

    #define CMD   0x00
    #define DATA  0x01
    #define READ  0x01
    #define WRITE 0x00

    #define TRIS_ACT_LED       TRISBbits.TRISB2
    // TRISAbits.TRISA2
    #define ACT_LED            LATBbits.LATB2
    // LATAbits.LATA2  


    void delay_10us(unsigned char t);
    void delay_ms(long t);

    void delay_10us(byte t)
    {
       int i;
       for (i=0;i<t;i++)
          Delay10TCYx(5);
    }

    void delay_ms(long t)   // delays t millisecs
    {
       do
       {
         delay_10us(99);    // not 100 to compensate for overhead
       } while(--t);
    }

    void delay_us(long us)
    {
        long x = (us%1000)/10;
        delay_ms(us/1000);
        delay_10us(x);
    }    
       


    void main (void)
    {
      int flip = 0;
      long i,j;

      //
      // Set direction registers
      //
      //TRISA= 0x00;
      //TRISB= 0x00;
      TRIS_ACT_LED = 0; TRISA=0x00;  TRISB=0x00;

      //LAT0xA=0x00;
      //LATB=0x00;
     
     
      while (1)
      {
        //ACT_LED = 0;
        //LATA= 0x00;
        LATB= 0x01;
        delay_ms(1);
        //ACT_LED = 1;
        //LATA= 0xFF;
        LATB= 0x02;
        delay_ms(1);
        LATB= 0x03;
        delay_ms(1);
        LATB= 0x04;
        delay_ms(1);
        LATB= 0x05;
        delay_ms(1);
        LATB= 0x06;
        delay_ms(1);
        LATB= 0x07;
        delay_ms(1);
        LATB= 0x08;
        delay_ms(1);
        LATB= 0x09;
        delay_ms(1);
        LATB= 0x00;
        delay_ms(1);
      }
    }
    You need 4 LED's, each with a 330ohm resistor and one leading from rb0, rb1 rb2 and rb3, or else it wont work. :D
     
  20. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Jaw drop, are you the real Krumlink? in C wow. Which C did you use?

    You should have no problem with the LED mux on Junebug. It's the same type of mux the PICkit 1 uses.
     

    Attached Files:

    Last edited: Nov 12, 2007
  21. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Krumlink is using MCC18 and an Inchworm+.

    I provided a simple program that blinked the ACT_LED using

    while(1)
    {
    ACT_LED = 1;
    delay_ms(10);
    ACT_LED = 0;
     

Share This Page