Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Oct 2014, 06:27
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Engineering/Science/Simulation
Sdcc the last version
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
mister_electronico


Joined: 20 Jan 2008
Posts: 659
Location: Asturias_ España

PostPosted: Wed 05 Mar 2014, 15:20    Post subject:  Sdcc the last version  

The last Sdcc pet version: Sdcc-3.4.0

This is a new version Sdcc

http://www.mediafire.com/download/3aj2xb456dlkaj2/sdcc-3.4.0-rc2.pet

See you.
Back to top
View user's profile Send private message Yahoo Messenger 
mister_electronico


Joined: 20 Jan 2008
Posts: 659
Location: Asturias_ España

PostPosted: Wed 02 Apr 2014, 14:11    Post subject:  

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/2d372tltqsllm7x/picsimlab0.5.0.pet


And install
Back to top
View user's profile Send private message Yahoo Messenger 
mister_electronico


Joined: 20 Jan 2008
Posts: 659
Location: Asturias_ España

PostPosted: Wed 02 Apr 2014, 14:15    Post subject: 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

Code:

// 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.
Back to top
View user's profile Send private message Yahoo Messenger 
mister_electronico


Joined: 20 Jan 2008
Posts: 659
Location: Asturias_ España

PostPosted: Wed 02 Apr 2014, 14:23    Post subject: 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.
board1b.png
 Description   
 Filesize   84.89 KB
 Viewed   142 Time(s)

board1b.png

Back to top
View user's profile Send private message Yahoo Messenger 
mister_electronico


Joined: 20 Jan 2008
Posts: 659
Location: Asturias_ España

PostPosted: Wed 02 Apr 2014, 14:26    Post subject: 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.
board1.jpg
Description 
jpg

 Download 
Filename  board1.jpg 
Filesize  143.14 KB 
Downloaded  93 Time(s) 
Back to top
View user's profile Send private message Yahoo Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Engineering/Science/Simulation
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0558s ][ Queries: 12 (0.0093s) ][ GZIP on ]