Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

The PIC18F2450 and PIC18F4450

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Forum Archives 2005-2006 » Archive through 01 August, 2006 » The PIC18F2450 and PIC18F4450 « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Dsaint
Frequent Contributor
Username: Dsaint

Post Number: 135
Registered: 06-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 11:03 am:   Edit Post Delete Post Print Post

The said devices support USB 2.0 is their any chance that some Guru would explain the possibilty and basic interface abilities

Bernard
dSaINt}S{ - interests electronics,control,broadcast,circuit design
Top of pagePrevious messageNext messageBottom of page Link to this message

Dsaint
Frequent Contributor
Username: Dsaint

Post Number: 136
Registered: 06-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 11:15 am:   Edit Post Delete Post Print Post

These devices are quite powerfull and useful though I am not grasping their USB properties - they have quite cool features I am reading about their internal oscilators - which implement acurate timing and PLL support, useful reset routines including power on reset and brown out reset - but I am missing something for sure any ideas
dSaINt}S{ - interests electronics,control,broadcast,circuit design
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 494
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 11:20 am:   Edit Post Delete Post Print Post

I've just done a design with the 2550. Nice chip; CPU runs at up to 48MHz, ie 12MIPS.

There are some nasty points to look out for when selecting the oscillator, but you can use an existing design as a template. I have a circuit you can use if you wish.

You will need to program it in C, of course, if you want to use the free Microchip USB code.

Mike.
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Dsaint
Frequent Contributor
Username: Dsaint

Post Number: 137
Registered: 06-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 11:27 am:   Edit Post Delete Post Print Post

Thanks Mike - it is quite intresting as a chip although i visualized its internal oscillator as weird - does it really work or ur better off with a crystal or a resonator

Also another question when you program in C or in Basic for PIC the program suite would convert to assembly?
Bernard
dSaINt}S{ - interests electronics,control,broadcast,circuit design
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 495
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 12:36 pm:   Edit Post Delete Post Print Post

Personally I'd always go for external crystal.

"when you program in C or in Basic for PIC the program suite would convert to assembly?"

C and BASIC work differently. BASIC is an interpreted language; what you write is actually read ( more or less ) by a small program called an interpreter that must be programmed into the PIC. C Code is "compiled", which means translated by a PC program into assembly language, which you download into the PIC. You can actually look at the assembly language output produced. This is quite useful because it is not unknown for compilers to generate bugs when converting C to assembler.

Some compilers for BASIC exist, but most work on the interpreter method.

I'll be discussing embedded C programming in a tutorial series starting later this year in EPE.

Cheers,

Mike.
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Dsaint
Frequent Contributor
Username: Dsaint

Post Number: 138
Registered: 06-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 12:46 pm:   Edit Post Delete Post Print Post

Thanks Mike - I would surely follow that series - a good programming series is needed and not only for the embeded even for interfacing and control it would be really interesting

Regards

Bernard
dSaINt}S{ - interests electronics,control,broadcast,circuit design
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 155
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 06:23 pm:   Edit Post Delete Post Print Post

Mike,
Your BASIC interpreter point isn't entirely correct.
BASIC STAMP’s (and PICAXE’s I think) do have interpreters’ on-board, thus wasting valuable PIC resources (code space, RAM and CPU cycles)

However, the Crownhill Proton+ BASIC compiler for example is just that. You enter BASIC source into an IDE (that supports colour syntax highlighting and all the other cool stuff we expect from programming IDE’s these days) on a PC and it compiles it to native PIC assembly, which then links to the Microchip Assembler to perform the actually assembly compile pass to generate the HEX instructions.
Because of this true compile nature, the generated HEX is no less efficient than that generated by a ‘C’ compiler (remembering of course that there are always good and bad compilers). Consequently, it generates a LST file that contains all the assembly (with comments).
I guess that no compiler will ever be as efficient as a competent programmer working in pure Assembly, but developing in higher level languages is certainly very productive and I’ve never yet had to revert to pure Assembly for any reason…. yet…. famous last words.

As it happens, the PROTON+ suit has a plug in for USB support. With just a couple of mouse clicks and answer a couple of simple questions it automatically adds all the necessary code for USB support. It can also generate a Visual Basic app for the PC to use in conjunction with your PIC.
It only took 10 mins to get a PIC talking to a PC using the wizard.

Joe
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 496
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 07:42 pm:   Edit Post Delete Post Print Post

Hi Joe,

I appreciate that point about basic compilers. I did actually put a note about it in my previous post, but I kept getting a server error until I took it out ( no joke! ). Maybe I hit a post length limit...

Basic is great as a quick prototyping language but I wouldn't like to write anything complex like a tcp/ip stack in it, compiled or not :o)

Mike.
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Not_a_number
Regular Contributor
Username: Not_a_number

Post Number: 25
Registered: 08-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 09:31 pm:   Edit Post Delete Post Print Post

Hello Mike,

You say that you wouldn't like to write anything complex in BASIC. Is there a technical reason for this or are you simply expressing a personal dislike?

- NaN
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 497
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2006 - 09:55 pm:   Edit Post Delete Post Print Post

It's a combination of both really. I'm sure you will find fans of BASIC who will say "of course you can", but as an engineer I'm a great fan of having lots of tools in my tool box, and using the right one for the job.

Technically, BASIC was not designed to facilitate structured programming techniques. Data structures for example, bit fields and a variety of control loop mechanisms are missing unlike languages such as C or C++. While some tool vendors have added these features they are not implemented to any standard so your code would not be portable. The 'B' in BASIC stands for 'Beginners' and it's difficult to throw off that underlying principle.

I've been programming in BASIC and C ( along with a few other languages ) for about 25 years now and I still find that C is my favorite language. It's a low level language which gives me a very close relationship with the hardware when I want it, but provides the features to enable me to produce portable, abstract, efficient software. I'm kind of biased in that sense and never really feel very happy when programming in BASIC or C++. My heart lies with assembly and C!

Mike.
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Not_a_number
Regular Contributor
Username: Not_a_number

Post Number: 26
Registered: 08-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 20 July, 2006 - 01:45 am:   Edit Post Delete Post Print Post

Hello Mike,

No, I'm not a fan of BASIC either; my favoured tools are C and C++, though perhaps more because they're what I 'always' use.

I'm not overly familiar with any particular version of BASIC, but am slightly sceptical that in terms of portability, abstraction and efficiency that there would always be much to choose between C and modern structured compiled BASIC.

Anyway, didn't Gosling intend Java to be the language of choice for embedded applications?

- NaN
Top of pagePrevious messageNext messageBottom of page Link to this message

Mikehibbett
Frequent Contributor
Username: Mikehibbett

Post Number: 500
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 20 July, 2006 - 08:24 am:   Edit Post Delete Post Print Post

Hi Nan,

>but am slightly sceptical

I'm slightly sceptical about your scepticism :o)

But I have no data on the efficiency side. I think it would be interesting to do some tests between say Proton+ and the C18 compiler. I'll ask the chaps at Crownhill if I can borrow a copy for an evaluation later in the year.

>didn't Gosling intend Java to be the language of choice for embedded applications?

yea, I think I read that somewhere too. I've never read the full story though.
-----
www.drivesentinel.co.uk - Home build GPS Speed Camera Detectors
Top of pagePrevious messageNext messageBottom of page Link to this message

Zeitghost
Frequent Contributor
Username: Zeitghost

Post Number: 288
Registered: 01-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 20 July, 2006 - 08:28 am:   Edit Post Delete Post Print Post

I think FORTRAN IV would be ideal for programming PICs.

Only trouble would be finding somewhere to put the punched cards... :o)
Top of pagePrevious messageNext messageBottom of page Link to this message

Eagre
Frequent Contributor
Username: Eagre

Post Number: 77
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 27 July, 2006 - 03:29 am:   Edit Post Delete Post Print Post

FORTRAN, and its derivatives like LLLTRAN, was a very effective language for heavy-duty number crunching. It lacked the sophistication of languages such as Algol and C, but was very efficient for numerical solutions of 3-dimensional PDE (usually with a degree of symmetry), provided that you commented it adequately (for your successors). In these situations, when we were talking about multi-hour Cray runs, compiler efficiency trumped language sophistication.

To quote the late poet laureate: "When it comes to slaughter, you will do your work on water ..."

Ed

Ed
Top of pagePrevious messageNext messageBottom of page Link to this message

Zeitghost
Frequent Contributor
Username: Zeitghost

Post Number: 298
Registered: 01-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 27 July, 2006 - 10:35 am:   Edit Post Delete Post Print Post

FORTRAN was designed for code efficiency, unlike C which was "designed" to make the compiler simple to write...

'Twas a humourous remark not a serious suggestion by the way... not a lot of card punchs or card readers aroung these days... and even fewer people who've actually used one.
Top of pagePrevious messageNext messageBottom of page Link to this message

Eagre
Frequent Contributor
Username: Eagre

Post Number: 78
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, 28 July, 2006 - 02:27 am:   Edit Post Delete Post Print Post

I've spent many hours at IBM card punches and carried hundreds of pounds of cards to the readers, I think for CDCs. When they came up with the HP terminals for the Crays it was a revolution, and somehow seemed like cheating. We still got our output as tons of thermal print paper to scan.

Ed

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page