![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) | |
| Quote:
Yes the instructions on the poster mostly apply, the poster is for version 7.x where 8.x has a release (normal) and debug selector on the toolbar but is otherwise similar to 7. | ||
| |
| | (permalink) |
| Hey guys... Just finished assembling my Junebug today, and I don't think its working quite right. I followed the directions to a T, and everything is identical to the picture. When I hook up to the USB cable, the green and yellow leds come on and the 3rd larger led comes on and goes off. I don't know where to start? | |
| |
| | (permalink) |
| o, and it shows 3.98 volts across U5V and GND | |
| |
| | (permalink) | |
| Quote:
3.8V seems too low though. Is that measured with a multimeter? | ||
| |
| | (permalink) |
| o, so it is working, lol. Yes, the voltage was measured with an old Fluke Multimeter. The only things I questioned during assembly was L1. All that was left that could go there was what looked like a larger resistor (1/2 watt?) than the rest. I think the colors were wrong for R6 also, but when I measured resistance of the one I installed in R6 it matched what the directions called for. Could either of these cause the low voltage? Last edited by thekyguy11; 1st February 2008 at 12:45 AM. | |
| |
| | (permalink) |
| Yep the "large resistor" is a big inductor. remove both PICs from the PCB and test the voltage again. | |
| |
| | (permalink) |
| 5.07 volts with both PICs removed. Is that normal? edit: I just reinserted the PICs, and I noticed I have the dip switches in backwards compared to the picture in the manual. I set them up like the picture and re-checked voltage and got 5.04v . I'm assuming everything is good now? Last edited by thekyguy11; 1st February 2008 at 05:57 AM. | |
| |
| | (permalink) | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | (permalink) |
| Make sure the PICs are in the right way round. | |
| |
| | (permalink) |
| yea, they were in correctly.. Anyways, I was able to get the demo where LED 4 flashes, and then I got the chasing LED to work. Everything was great...But, when I tried to change the code for the chasing LED one, it looked kinda goofy, so I tried to re-load the blinky.asm that you provided. For some reason it acts like LED 2 and LED 5 are backwards. When I erase using the pickit2 software and it sits idle, LED 3 kinda dimly flickers on and off like one of those fake candle bulbs you see at christmas time. I tried deleting everything I created off the computer and starting from scratch with fresh code, but it still won't "chase" properly. I wouldn't really care, but I feel like it could be a hardware issue. | |
| |
| | (permalink) |
| It sounds like it's fine. LED3 will flicker on a blank 18F1320 because the 18F1320 thinks it's an oscillator and an LED can act as a cap, moving your hand near it or touching it will stop it from happening. Charlieplexing LEDs can be a little daunting. Here's the Blink program Swordfish BASIC and the module for the Junebugs LEDs. Swordfish .hex files can be loaded using the PICkit2 standalone software or programmed directly using PK2CMD.EXE Edit rewritten module using High(x) and Low(x) commands. Blinky Swordfish BASIC SE for the Junebug Code: {
*****************************************************************************
* Name : BLINK_1.BAS *
* Author : William Richardson *
* Notice : Copyright (c) 2008 blueroomelectronics *
* : All Rights Reserved *
* Date : 1/7/2008 *
* Version : 1.0 *
* Notes : *
* : *
*****************************************************************************
}
Device = 18F1320
Clock = 4 // 4MHz clock
Include "junebug.bas"
Dim Count As Byte
While True
For Count = 0 To 6
LED(Count)
DelayMS(300) // delay in 1000s of a second
Next
Wend // repeat forever
End Code: {
*****************************************************************************
* Name : JUNEBUG.BAS *
* Author : William Richardson *
* Notice : Copyright (c) 2008 blueroomelectronics *
* : All Rights Reserved *
* Date : 2/1/2008 *
* Version : 0.91beta *
* Notes : *
* : *
*****************************************************************************
}
Module Junebug
Device = 18F1320
Public Sub LED(x As Byte)
Select x
Case 1 // LED 1
TRISA.0 = 0
TRISA.6 = 0
TRISA.7 = 1
High(PORTA.0)
Low (PORTA.6)
Case 2 // LED 2
TRISA.0 = 0
TRISA.6 = 0
TRISA.7 = 1
Low (PORTA.0)
High(PORTA.6)
Case 3 // LED 3
TRISA.0 = 1
TRISA.6 = 0
TRISA.7 = 0
High(PORTA.6)
Low (PORTA.7)
Case 4 // LED 4
TRISA.0 = 1
TRISA.6 = 0
TRISA.7 = 0
Low (PORTA.6)
High(PORTA.7)
Case 5 // LED 5
TRISA.0 = 0
TRISA.6 = 1
TRISA.7 = 0
Low (PORTA.0)
High(PORTA.7)
Case 6 // LED 6
TRISA.0 = 0
TRISA.6 = 1
TRISA.7 = 0
High(PORTA.0)
Low (PORTA.7)
Else // All LEDs Off
TRISA.0 = 1
TRISA.6 = 1
TRISA.7 = 1
End Select
End Sub
Config OSC = INTIO2, WDT = OFF, LVP = OFF
ADCON1 = %11110101
OSCCON = $62 // 4 MHz clock Last edited by blueroomelectronics; 1st February 2008 at 08:22 PM. | |
| |
| | (permalink) |
| I love how quickly you reply! It took a minute, but I figured out how to get that to work using swordfish. Much easier than MPLAB in my opinion. But if they are supposed to be chasing in order, they aren't. It goes... 1-3 and 5 together-3-4-5-6, 2 never even lights. What am I doing wrong? | |
| |
| | (permalink) |
| Does the assembly version in the manual work fine for you? Try to turn the LEDs on one at a time, I'll repost with a modified Junebug module. Swordfish is very nice, I just started playing with their new LCD plugin. ![]() Last edited by blueroomelectronics; 1st February 2008 at 08:03 PM. | |
| |
| | (permalink) |
| It did work, but only the first time. For some reason, it seems like ever since I changed the assembly code, it wont work right. I was going to ask how to turn them on one at a time, but you beat me to it. Seems like a good troubleshooting technique. | |
| |
| | (permalink) |
| Hmm sounds like a config problem, try adding Code: Config OSC = INTIO2, WDT = OFF, LVP = OFF Swordfish does not have debug support but is otherwise excellent and I even like its IDE Edit refresh your browser, I've rewritten the Junebug module with the High & Low pin commands. Last edited by blueroomelectronics; 1st February 2008 at 08:23 PM. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Junebug kit ready, (PICkit2 & tutor) | blueroomelectronics | Micro Controllers | 37 | 28th October 2007 03:47 AM |
| Assembly? | Marks256 | Micro Controllers | 43 | 28th July 2006 04:45 PM |
| Assembly compiler | Thunderchild | Micro Controllers | 4 | 12th March 2006 02:25 PM |
| Learning Assembly Programming Language | Johnson777717 | Micro Controllers | 4 | 22nd March 2004 03:00 PM |
| Assembly Language Question | Jeggyman | General Electronics Chat | 6 | 30th January 2004 10:54 PM |