navitron
 
Renewable Energy and Sustainability Forum
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address. Following continuous spam/hack attempts on the forum, "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: Navitron Partners With Solax to Help Create A More Sustainable Future | Navitron Calls for Increased Carbon Footprint Reduction In Light of Earth Overshoot Day | A plea from The David School - Issue 18
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: Simple PIC compiler / Emulator  (Read 8580 times)
Ivan
Hero Member
*****
Offline Offline

Posts: 2262


« on: November 09, 2010, 02:42:17 AM »

I want to do a little PIC programming - it's been a few years since I played with these, and I was never anything more than a novice.

I'm not good at languages, except my mother tongue which is BASIC (and I can pretty much do anything in BASIC). Previously I purchased two types of PIC BASIC. Both were full of flaws. I purchased one of them, tried to write my program, found the flaws which prevented me from doing so, and wrote to tell them about the bugs - they told me that they wouldn't be updating, so I purchased an alternative BASIC, a few months later, I had a similar complaint. This company told me they 'no longer support this version' and I had to upgrade (ie ) to the latest version in order to get technical support. If only selling was this easy with non-virtual products! 'Sorry Sir, I don't care if you haven't got any output from your PV, you need to upgrade to this month's PV system in order to get technical support. That will be 80% of what you paid for your PV system last month'

What's the best bet? Is there a PIC BASIC which works? Or do I have to teach an old dog to learn C? Which is the best programmer/debugger/compiler to use? Is there such a thing as a virtual simulator where you can test the PIC code on a virtual PIC preferrably within the compiler/programmer software?
Logged

www.epogee.co.uk - Solar PV & Solar Thermal Training / MCS
breezy
Full Member
***
Offline Offline

Posts: 170


Omnibus bendibus


« Reply #1 on: November 09, 2010, 05:15:47 AM »

Have you met the cow?

http://gcbasic.sourceforge.net/

The price is right.  Grin
Logged

This message handcrafted from 100% recycled electrons. Caution: May contain nuts
Alan
Guest
« Reply #2 on: November 09, 2010, 08:06:12 AM »

http://www.oshonsoft.com/pic.html

Very fair price. Basic code and excellent simulation.

Free updates / bug fix over many years.

Regards

Alan
Logged
StBarnabas
Hero Member
*****
Offline Offline

Posts: 2221


St Barnabas Chapel (2009)


« Reply #3 on: November 09, 2010, 08:28:59 AM »

Ivan you could try

http://www.sourceboost.com

this has a basic compiler - though I use the C part of the environment. (To be honest I normally program PICs in assembler).

What are you trying to do? There are some very good PIC programmers on the forum, so they might be able to help. Even OK ones like me might be able to sort something out.
Sean
« Last Edit: November 09, 2010, 08:48:16 AM by StBarnabas » Logged


Gestis Censere. 40x47mm DHW with TDC3. 3kW ASHP, 9kW GSHP, 3kW Navitron PV with Platinum 3100S GTI, 6.5kW WBS, 5 chickens. FMY 2009.
ericw
Hero Member
*****
Offline Offline

Posts: 774


« Reply #4 on: November 09, 2010, 08:35:58 AM »

Great Cow also has a free clunky flow chart based version.

But I would concur with Alan, Oshonsoft is very good, has a simulator and routines for many of the standard types of I/O eg 1 wire built in.

Eric
Logged
Baz
Hero Member
*****
Offline Offline

Posts: 1391


« Reply #5 on: November 09, 2010, 01:48:04 PM »

Are your requirements too time sensitive for a Picaxe? If you don't like its command set you could look at the Kronos Athena which has some added features but still simple Basic. I wrote a serial controlled 8 channel light dimmer for the latter so it is pretty versatile.
Logged
2ndBillericay
Full Member
***
Offline Offline

Posts: 113



WWW
« Reply #6 on: November 09, 2010, 03:10:49 PM »

I have just started playing with the Arduino PIC after a brief interlude with the PicAxe. Looking good so far.
Logged

2.16 Kw = 9 x 240w on flat roof, South facing and at 20 degrees. - Installed 26-08-10
Nuclear Fussion Thermal system DeltaSol BS & DL2 - installed 25-03-11
StBarnabas
Hero Member
*****
Offline Offline

Posts: 2221


St Barnabas Chapel (2009)


« Reply #7 on: November 09, 2010, 08:21:00 PM »

SourceBoost is free I think for a single licence and also has 1-wire and a simulator/debugger so is worth a look
Logged


Gestis Censere. 40x47mm DHW with TDC3. 3kW ASHP, 9kW GSHP, 3kW Navitron PV with Platinum 3100S GTI, 6.5kW WBS, 5 chickens. FMY 2009.
Ivan
Hero Member
*****
Offline Offline

Posts: 2262


« Reply #8 on: November 15, 2010, 01:10:37 AM »

I'm growing mushrooms on a small scale (edible mushrooms, before you ask!). The ones that are easiest to grow are oysters, and they really are very easy, but they require high humidity as well as frequent air changes, otherwise they grow deformed.

I'm planning to build a controller to control four things - Light (Timed On/Off), Humidity (via timed On/Off cycling), Ventilation (timed on/off cycling, but synchronised with humidity control so that it doesn't exhaust the air during or immediately after the humidifier comes on), and temperature (requires temperature input).

My plan was to use a PIC (because I've experimented with these in the past) - although there's no reason why it should be a PIC, other than to save me learning another half-baked skill. The controller should have 4 relay outputs (12v or 240v), three button inputs (menu up/down and select), a 2line alphanumeric display and a temperature sensor input (one-wire? I've got a few of these kicking around). I also fancied in the future incorporating a CO2 sensor and a humidity sensor, but I believe these would need to be special heated sensors due to the high humidity environment (85-100%).

I've worked out most of the logic - should be quite straightforward, but the things that slow me down are 1)addressing the one-wire sensor 2)addressing the display 3)incorporating these into the program loops.

Pictures of some of my mushrooms attached


* big_pink_small.JPG (24.44 KB, 384x320 - viewed 938 times.)

* CIMG5217_small.JPG (71.62 KB, 292x390 - viewed 939 times.)

* oyster_small.JPG (62.09 KB, 175x233 - viewed 907 times.)
Logged

www.epogee.co.uk - Solar PV & Solar Thermal Training / MCS
Alan
Guest
« Reply #9 on: November 15, 2010, 08:52:31 AM »

Quote but the things that slow me down are 1)addressing the one-wire sensor 2)addressing the display 3)incorporating these into the program loops.
Sample code written here.

http://www.oshonsoft.com/pic18basiccompilerreferencemanual.html#505
You can simulate operation before loading into Pic

Regards
Alan
Logged
KenB
Hero Member
*****
Offline Offline

Posts: 2694


Energy Self Enlightenment


WWW
« Reply #10 on: November 15, 2010, 09:07:22 AM »

Ivan,

May I suggest you take this opportunity to join the Arduino community.  It's easy to learn, there is plenty of support and the hardware is abundant and cheap.

If you started with a "Freeduino" and sensor shield from NuElectronics (<30) this would give you a basic platform to build your system on. It has the added advantage of a battery backed realtime clock and a socket to take a SD card. So you immediately have the basis to build a time stamped multichannel datalogger - using Eric's code.

http://www.nuelectronics.com/estore/index.php?main_page=index&cPath=7&zenid=5b1a12f91cd232229ca458fbe3bd5db8

The datalogging shield has 6 sockets to take external sensor hardware such as Dallas 18B20, temp/humidity sensor and also relay boards.

There is also a choice of LCD shields - The Nokia 3310 at 10 is good for graphics and comes with a 5 axis "joy-button". Alternatively for 11, a traditional 2 line LCD display with 5 push buttons.

Having toiled with PIC assembler code for 10 years with painfully slow progress, it was only the Arduino that tempted me to leap in and learn C.  Now with the basics of C, I can now on tackle just about any microcontroller because of C's portability across platforms. My day job involves writing C code for motor control on a 32bit DSP, something I would have floundered at , had I not spent a year tinkering with Arduino.


Ken
Logged
ericw
Hero Member
*****
Offline Offline

Posts: 774


« Reply #11 on: November 15, 2010, 09:58:32 AM »

Ivan,

If you really do want to stick with PIC assembler code, then attached is the code I used in my solar panel controller.
This happens to contain most of the routines you would need and so might be a source of inspiration.
It  is written for an Olimex PIC-MT board which has the buttons and display built in.

Eric

* Solar1.txt (19.78 KB - downloaded 430 times.)
Logged
skyewright
Hero Member
*****
Offline Offline

Posts: 1769


« Reply #12 on: November 15, 2010, 10:17:26 AM »

May I suggest you take this opportunity to join the Arduino community.  It's easy to learn, there is plenty of support and the hardware is abundant and cheap.
Thanks Ken. I was just musing over which way to go between PIC & Arduino for dipping my toe in to the control side of things. I think your post may have decisively swung the balance towards Arduino.
Logged

Regards
David
3.91kWp PV  (17 x Moser Baer 230 and Aurora PVI-3.6-OUTD-S-UK), slope 40, WSW, Lat 57 9' (Isle of Skye)
dhaslam
Hero Member
*****
Offline Offline

Posts: 6775



« Reply #13 on: November 15, 2010, 10:31:00 AM »

Why use Arduino instead of just a one wire system with adapter to a PC?   
Logged

DHW 250 litre cylinder  60 X 47mm tubes
Heating  180,000 litre straw insulated seasonal store, 90X58mm tubes + 7 sqm flat collectors, 1 kW VAWT, 3 kW heatpump plus Walltherm gasifying stove
skyewright
Hero Member
*****
Offline Offline

Posts: 1769


« Reply #14 on: November 15, 2010, 02:49:24 PM »

Why use Arduino instead of just a one wire system with adapter to a PC?   
I already do have a 1-wire system as part of my weather & environmental logging set up (which centres on Meteohub running on an ALIX-1D), but I hadn't considered it for control purposes. The Arduino seems to have a lot of nice handy 'bits & bobs' with UK suppliers.  Smiley
Logged

Regards
David
3.91kWp PV  (17 x Moser Baer 230 and Aurora PVI-3.6-OUTD-S-UK), slope 40, WSW, Lat 57 9' (Isle of Skye)
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!