![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi All, First post here so Hi Im new to pics and quite excited. (Nerdy I know but hey) and I have read the sticky here about newbies like me. There are a few sites I have read and as some are old and some are new I thought I would ask a few questions please. If they are stupid or exist somewhere else then I do appolagise.I have decided to go with 18Fs. I see from the sticky that I can program them via USB without a hardware programmer but I would need a hardware programmer to put a bootloader on first. Is this really correct? I was hoping not to buy a hardware programmer. Can you buy PICs with the bootloader already on? I would like to program in C and I am downloading boostC. Are there any good examples out there other than ones on the vendor site? Thanks for your time guys Merry xmas and take care Danny | |
| |
| | #2 |
|
Buy a Junebug or PICKit2, programmer and debugger - then you can load your own bootloaders if you really want to.
| |
| |
| | #3 |
|
A bootloader does not allow for ICD akd In Circuit Debugging. The $50 or so for a Junebug or PICkit2 is well worth the money go get it. BoostC is a good compiler choice. The difference between boostC and C18 are small from the syntax level. Given the basic layout of a simple bootC program it is easy to see how C18 programs can be modified to run with bootC. This is a file I wrote that allows me to compile the same code using BoostC or C18. If you know C it should make the differences clear. Mostly it is setting up the chip, register and register bit field names. In this file the bootC #pragma DATA and C18 #prarma config settings are for a 18F1320 the junebutg target chip. They should be modified as needed. Code: /*
* Junebug Demo
* Purpose: Demonstrate cooporative multitasking
*
* File: multiCompiler.h
* Software: BoostC or Microchip C18 compilers
* Hardware: Junebug (or other debugger + breadboarded circuit)
*
* These defiles allow the use of more then one compiler.
* Register names ending with a single _ are byte referances.
* Register names ending with a dual __ are bit referances.
*
* by Daniel Johnson
* July 2008
*/
#ifdef _BOOSTC
#define FOUND_COMPILER
#define lata_ lata
#define trisa_ trisa
#define porta_ porta
#define latb_ latb
#define trisb_ trisb
#define portb_ portb
#define intcon_ intcon
#define intcon2_ intcon2
#define osccon_ osccon
#define t0con_ t0con
#define t0con__ t0con
#define adcon1_ adcon1
#include <system.h>
#pragma CLOCK_FREQ 8000000
#pragma DATA _CONFIG1H, _INTIO2_OSC_1H
#pragma DATA _CONFIG2H, _WDT_OFF_2H
#pragma DATA _CONFIG3H, _MCLRE_ON_3H
#pragma DATA _CONFIG4L, _LVP_OFF_4L
#endif
// MCC18
#ifdef __18CXX
#define FOUND_COMPILER
#define lata_ LATA
#define trisa_ TRISA
#define porta_ PORTA
#define latb_ LATB
#define trisb_ TRISB
#define portb_ PORTB
#define intcon_ INTCONbits
#define intcon2_ INTCON2bits
#define osccon_ OSCCONbits
#define t0con__ T0CONbits
#define t0con_ T0CON
#define adcon1_ ADCON1
#pragma config OSC = INTIO2, WDT = OFF, LVP = OFF
#include <p18f1320.h>
// code to make C18 interrupt look like BoostC's
void interrupt(void);
#pragma code low_vector=0x18
void low_interrupt (void)
{
_asm GOTO interrupt _endasm
}
#pragma code
#pragma interruptlow interrupt
#endif
#ifndef FOUND_COMPILER
error: unknown compiler
#endif
__________________ Please post questions to the forums. PM's are for personal communication. BCHS/3v0's Tutorials Junebug USB PIC programmer kit., USB Bit Whacker, The 15 Minute Printed Circuit Board! (+drill time) Last edited by 3v0; 9th December 2008 at 04:22 PM. | |
| |
| | #4 | |
| Quote:
I see you are from england. Is there anywhere you can recommend or an alternative please? | ||
| |
| | #5 | |
| Quote:
Thanks for the reply and the code. I will look at the junebug too. Wish there was someone in the UK selling them as I dont really want to wait weeks while it gets shipped to the UK ![]() Thanks again. | ||
| |
| | #6 |
|
Wasn't there a deal on the PICkit2 in the UK?
| |
| |
| | #7 | |
|
Hi, Quote:
If you want one 'today' Farnells have them in stock at £35 + carriage btw - I sent you a PM that might help Richard | ||
| |
| | #8 |
| | |
| |
| | #9 |
| It doesn't usually take weeks, just a couple of days.
| |
| |
| | #10 |
|
The original PK2 was on sale. My Junebug kit is a compatible but includes an 18F1320 for learning. Take a look at the JPUG issues on my site for more info on the tutor.
| |
| |
| | #11 |
|
Please, whatever you do. Don't get the velleman PIC kit. I bought my programmer from E-Bay, it is "cheap-n-nasty" but does the job. I use SourceBoost IDE and PICPgm, they work very well together. JDM PIC Programmer Microchip 16F84 - 40 & 18 ZIF Socket on eBay, also Assemblies EM Devices, Components Supplies, Electrical Test Equipment, Business, Office Industrial (end time 01-Jan-09 09:57:36 GMT)
__________________ when you post that reply, im just kidding. | |
| |
| | #12 |
|
If you are living in UK, just get the genuine Microchip PicKit2 Programmer/Debugger via the EPE deal. It ends January next year. It also comes with a demo board with PIC, soldered LEDs, VR and push buttons. All that delivered to your home and you even got change for a tenner.
__________________ L.Chung | |
| |
| | #13 | |
| Quote:
Thanks | ||
| |
| | #14 |
|
No subscription is needed. The offer is opened to anyone reading the magazine. Last time I checked it is also mentioned in the current month EPE magazine. You can always give Mr. W.H.Smith a call if you want the details.
__________________ L.Chung Last edited by eblc1388; 9th December 2008 at 07:15 PM. | |
| |
| | #15 | |
| Quote:
I have the discount code now (via the "not so good internet") but I did not want to miss out on this ![]() Now I guess I sit back and wait and read all the good posts here. Thanks again guys | ||
| |
|
| Tags |
| chicken, egg |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Chicken Incubator Humidifier Help | ainsof | Electronic Projects Design/Ideas/Reviews | 7 | 23rd April 2009 02:22 AM |
| Chicken coop door control | perthdownunder | Electronic Projects Design/Ideas/Reviews | 9 | 16th December 2008 10:05 PM |
| Bipedal Chicken Walker | ultimatekiller | Robotics Chat | 2 | 9th October 2007 04:45 AM |