The last Sdcc pet version: Sdcc-3.4.0
This is a new version Sdcc
http://www.mediafire.com/download/3aj2x ... .0-rc2.pet
See you.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
Sdcc the last version
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Sdcc the last version
Last edited by mister_electronico on Sun 08 Feb 2015, 18:40, edited 1 time in total.
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
If you download it and install this pet and you could see how the process of compiling a program and watch as your running the simulator Picsimlab in the next example.
Download too Picsimlab
http://www.mediafire.com/download/2d372 ... b0.5.0.pet
And install
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
Download too Picsimlab
http://www.mediafire.com/download/2d372 ... b0.5.0.pet
And install
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 18:40, edited 1 time in total.
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Compiling with Sdcc
Sdcc is a little confusing when you compile, you better have a template programs, create programs from these templates, this will avoid many problems.
Good copy these command lines to a file eg sample.c
Well basically what the program to anyone who understands a bit of C and microcontrollers is on and off the leg RB1 of the microcontroller.
Once done this and we reported in the part of code not to compile the program text to write the next line.
# sdcc -mpic14 --use-non-free -p16f677 --debug -I -c sample.c
If all goes well I guess if that is proven to us appear the following files:
example.adb example.asm example.c example.cod example.hex example.lst example.o prueba.p
In which the most important are the prueba.hex to stick it to the microcontroller bone record files, which would be the asm program written in assembler, of extensions., Or if we use this Prgrm to compile other applications ... etc ..
Well once I done this just this part.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
Good copy these command lines to a file eg sample.c
Code: Select all
// THIS PROGRAM IS FOR SDCC LED ON AND OFF DELAY.
//
// To compile ENTER THE FOLLOWING COMMAND LINE
//
// sdcc -mpic14 --use-non-free -p16f677 --debug -I -c ejemplo.c
//
#include "pic16f877.h"
typedef unsigned int word;
word __at(0x2007) CONFIG = _XT_OSC & _WDT_OFF & _PWRTE_OFF & _BODEN_ON &
_LVP_ON & _CPD_OFF & _WRT_ENABLE_ON & _DEBUG_OFF & _CP_OFF;
void delay_ms(long ms)
{
long i;
while (ms--)
for (i=0; i < 300; i++);
}
void main() {
TRISB1 = 0;
while(1) {
RB1=0;
delay_ms (200);
RB1=1;
delay_ms (200);
}
}
Well basically what the program to anyone who understands a bit of C and microcontrollers is on and off the leg RB1 of the microcontroller.
Once done this and we reported in the part of code not to compile the program text to write the next line.
# sdcc -mpic14 --use-non-free -p16f677 --debug -I -c sample.c
If all goes well I guess if that is proven to us appear the following files:
example.adb example.asm example.c example.cod example.hex example.lst example.o prueba.p
In which the most important are the prueba.hex to stick it to the microcontroller bone record files, which would be the asm program written in assembler, of extensions., Or if we use this Prgrm to compile other applications ... etc ..
Well once I done this just this part.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 18:41, edited 1 time in total.
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Example with Picsimlab
The Picsimlab program has a menu entry in :
Menu> Utility> Picsimlab.
Well this program has 6 types of coaches who are very good and the truth is that this program is very well
Well if we open the program we see a drop down to the left in this case will not have to touch and laying Board and coach 1 leave like this.
Then down the frequency that I leave in 4 Mhz which is the default one I think.
Good examples you can load in the toolbar:
File> Load Hex "or load the hex file"
These files are in the directory:
/usr/local/share/picsim/lab/examples
All directories that begin with the letter corresponding to coach b1_ board 1 to 1 and you can upload to them as they work.
This is of course to upload files with extension *. Hex
Well I what I do is that in this directory create another directory:
/EXERCISES'm hanging in there and folders /EXAMPLE1 /EXAMPLE2 ...
and it is in /EXERCISES/EXAMPLE1 where I put all the files that I generated in the previous post.
Well if I do and seek Picsimlab this directory and load the hex file, as we will see us off and the LED lights RB1, as programmed.
I put the image of the coach and the Led.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
Menu> Utility> Picsimlab.
Well this program has 6 types of coaches who are very good and the truth is that this program is very well
Well if we open the program we see a drop down to the left in this case will not have to touch and laying Board and coach 1 leave like this.
Then down the frequency that I leave in 4 Mhz which is the default one I think.
Good examples you can load in the toolbar:
File> Load Hex "or load the hex file"
These files are in the directory:
/usr/local/share/picsim/lab/examples
All directories that begin with the letter corresponding to coach b1_ board 1 to 1 and you can upload to them as they work.
This is of course to upload files with extension *. Hex
Well I what I do is that in this directory create another directory:
/EXERCISES'm hanging in there and folders /EXAMPLE1 /EXAMPLE2 ...
and it is in /EXERCISES/EXAMPLE1 where I put all the files that I generated in the previous post.
Well if I do and seek Picsimlab this directory and load the hex file, as we will see us off and the LED lights RB1, as programmed.
I put the image of the coach and the Led.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
- Attachments
-
- board1b.png
- (84.89 KiB) Downloaded 513 times
Last edited by mister_electronico on Sun 08 Feb 2015, 18:41, edited 1 time in total.
- mister_electronico
- Posts: 969
- Joined: Sun 20 Jan 2008, 20:20
- Location: Asturias_ España
- Contact:
Escheme first board
An observation schedule if you want to work with these coaches need to see their schematics, well, these are within the directory
/usr/local/share/picsim/lab/doc
Here I leave the scheme of the first coach to work.
If someone takes a test, I hope that this comment here your experience.
See you and greeting.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
/usr/local/share/picsim/lab/doc
Here I leave the scheme of the first coach to work.
If someone takes a test, I hope that this comment here your experience.
See you and greeting.
______________________________________________________________________
My blog
https://misterelectronicoes.wordpress.com/
- Attachments
-
- board1.jpg
- (143.14 KiB) Downloaded 627 times