Simple Circuit
Simple Circuit
Hello, I got my development board today and flowcode3.
I previously had a "bread block prototype board" eblock, that is connected to port a and b.I have connected the power supply from the development board to the prototype board. How could I go about making a simple circuit on this prototype board? I just want to be able to "turn a light" on and off.
Edit: Sorry, this is supposed to be in the e-block forum.
Cheers
I previously had a "bread block prototype board" eblock, that is connected to port a and b.I have connected the power supply from the development board to the prototype board. How could I go about making a simple circuit on this prototype board? I just want to be able to "turn a light" on and off.
Edit: Sorry, this is supposed to be in the e-block forum.
Cheers
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello Eddie
All you need to do is choose an output pin that will control the light and then connect the following circuit to that pin.
uC pin -- LED -- 220 Ohm Resistor -- GND
This will drive the LCD using the microcontroller pin.
To drive a light eg a small bulb you will need to boost the current using a transistor so the circuitry would be like this.
uC pin -- 1k resistor -- Base pin of Transistor
+5V -- Emittor pin of Transistor
Collector pin of Transistor -- Bulb -- small value Resistor -- GND
All you need to do is choose an output pin that will control the light and then connect the following circuit to that pin.
uC pin -- LED -- 220 Ohm Resistor -- GND
This will drive the LCD using the microcontroller pin.
To drive a light eg a small bulb you will need to boost the current using a transistor so the circuitry would be like this.
uC pin -- 1k resistor -- Base pin of Transistor
+5V -- Emittor pin of Transistor
Collector pin of Transistor -- Bulb -- small value Resistor -- GND
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 209
- Joined: Thu Oct 19, 2006 11:46 am
- Location: Bakewell, UK
- Has thanked: 20 times
- Been thanked: 16 times
- Contact:
Hello world with Flowcode
Eddie,
Ports A and B bring out their 8 port pins and ground to the breadboard. I assume you will be using a LED as your light source, as these are low voltage (about 1.5v) and low current (PIC ports can nominally source 25mA but voltage drops long before this).
So simply connect one pin of the LED to ground and another (the leg with the thin bit in the casing) to a port pin. All ports are protected by 220ohm resistors so there should be no problem unless you have a high brightness type etc..
Now use flowcode, in a loop to : turn on the port pins, delay about 200ms or more, then turn off the port pins and delay again. Simulate the code to show that it works on screen. If it then does not work on the harware then check and recheck your configuration code settings.
I would avoid port A to start with as it has various idosyncracies, such as no pull up on RA4 and only 5 outputs on most chips.
Also I suggest downloading and reading the Microchip data sheet on your device of choice, it should make most things much clearer.
http://www.microchip.com/stellent/idcplg IdcService=SS_GET_PAGE&nodeId=74
This should give you your 'Hello world' example, good luck.
This post crossed with the ones above, but its here anyway.
Ports A and B bring out their 8 port pins and ground to the breadboard. I assume you will be using a LED as your light source, as these are low voltage (about 1.5v) and low current (PIC ports can nominally source 25mA but voltage drops long before this).
So simply connect one pin of the LED to ground and another (the leg with the thin bit in the casing) to a port pin. All ports are protected by 220ohm resistors so there should be no problem unless you have a high brightness type etc..
Now use flowcode, in a loop to : turn on the port pins, delay about 200ms or more, then turn off the port pins and delay again. Simulate the code to show that it works on screen. If it then does not work on the harware then check and recheck your configuration code settings.
I would avoid port A to start with as it has various idosyncracies, such as no pull up on RA4 and only 5 outputs on most chips.
Also I suggest downloading and reading the Microchip data sheet on your device of choice, it should make most things much clearer.
http://www.microchip.com/stellent/idcplg IdcService=SS_GET_PAGE&nodeId=74
This should give you your 'Hello world' example, good luck.
This post crossed with the ones above, but its here anyway.
Go with the Flow.
Hello Mark,
Ill try constructing this simple circuit and report back. But I think im going to need to find a 13.v5 power supply so that I can put my board into low voltage mode. I would have thought it come in low voltage mode.... Again, its not letting me clear the chip and write to it at the moment....
Cheers
Ill try constructing this simple circuit and report back. But I think im going to need to find a 13.v5 power supply so that I can put my board into low voltage mode. I would have thought it come in low voltage mode.... Again, its not letting me clear the chip and write to it at the moment....
Cheers
Here is part of the build log:
Building CASM file
Memory Usage Report
===================
RAM available:368 bytes, used:2 bytes (0.6%), free:366 bytes (99.4%),
Heap size:366 bytes, Heap max single alloc:111 bytes
ROM available:4096 words, used:68 words (1.7%), free:4028 words (98.3%)
Successful
Return code = 0
Launching the programmer...
Sending program...
Erasing the PICmicro
....
Writing program memory
Writing configuration memory
Programming failed: <config1> & <config2>
That took 3.296 seconds
Return code = 0
FINISHED
Building CASM file
Memory Usage Report
===================
RAM available:368 bytes, used:2 bytes (0.6%), free:366 bytes (99.4%),
Heap size:366 bytes, Heap max single alloc:111 bytes
ROM available:4096 words, used:68 words (1.7%), free:4028 words (98.3%)
Successful
Return code = 0
Launching the programmer...
Sending program...
Erasing the PICmicro
....
Writing program memory
Writing configuration memory
Programming failed: <config1> & <config2>
That took 3.296 seconds
Return code = 0
FINISHED
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
The 16F88 chips in the boards we ship should already be in LVP mode. The program in there should be a "knight-rider" effect (perhaps that should be a "cylon (bsg)" effect for those less than 30!). This should miss out the RB3 LED (because this is the LVP pin and can't be used as an i/o pin).
You may need to put the jumpers in the appropriate settings for LVP programming without a power supply - i.e. J29 = USB; J12-4 = USB, J11 = LVP.
You may need to put the jumpers in the appropriate settings for LVP programming without a power supply - i.e. J29 = USB; J12-4 = USB, J11 = LVP.
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
for LVP programming, the appropriate LVP pin must be set by these 3 jumpers. For the 16F88, RB3 is the LVP pin. So the "jumper selection bits" in the bottom right of the board should be as follows:
RB3 = right (LVP PROG)
RB4 = left (I/O PORT)
RB5 = left (I/O PORT)
This should be detailed in the PDF for the EB006 eblock.
RB3 = right (LVP PROG)
RB4 = left (I/O PORT)
RB5 = left (I/O PORT)
This should be detailed in the PDF for the EB006 eblock.