Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 21st November 2004, 10:29 AM   (permalink)
Default wow

i think that people like youself have another way of thinking when i was at college i noticed that a couple of the lads would just think in code (or so it appeared ) unlike me who needed lots of drawings and little bits of paper.
ok will try this out and see what we get hmmm looking at your diagram i think there will be at least one problem, the project board i am using has leds connected to rb0-rb5 and swiches that when pushed give a voltage to ra0-ra3 a 4 switch 6 led arangement ...ok ill have a go and thanks

HEY looking at your post times you dont sleep much do you .... nor do i
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. ....Asking many questions could make you appear to be a Master! Just Remember Appearances can often be decieving.
Ricardoco is offline  
Old 21st November 2004, 02:04 PM   (permalink)
Default getting there

ok ive managed to make it work (both the pulse and the vu type led arrangment) in basic although it seems a bit clunky and there dosnt seem to be anyone who is programming pics in basic on here to help so while i ponder it im going to have a closer look at this assembler and see what is going on with that.. in the mean time if you are good at the basic side of it then let me know and ill pm the code to you as i dont think it is liked when big chunks of code are posted here... and by the way can i say that the people willing to help me on here is fantastic and i thank you all very much this is what forums should be like, most are full of people who well lets just say it is fine if you can speak several languages as long as you dont lose the ability to speak english politely thankfully i ahvnt met anyone on here who suffers with that problem again i cant thank you enough
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. ....Asking many questions could make you appear to be a Master! Just Remember Appearances can often be decieving.
Ricardoco is offline  
Old 21st November 2004, 08:38 PM   (permalink)
Default

I don't have a PIC Basic compiler or simulator, so I wouldn't be able to propery try to code it on the fly and be sure my method or code would work, without actually trying it myself. The assembler in MPLAB is free, so I just went with that. I'm quite a night owl on weekends too. :P

The issue of the buttons is very easy to fix. In the Main loop, there is a BTFSS command, which will skip the next instruction of the specified bit of the specified variable is a 1. But the following command will get executed if it a 0. hence "Bit Test F Skip if Set". For use with a switch that gives a high when pressed, simply change the two tests in Main loop to btfsc, "Bit Test F Skip if Clear".

As for drawings and paper, in any but the most trivial cases, they are pretty well necessary. For this little project I pretty well coded it in my head. "Test for pushed button, increase counter to reflect current state, change bit pattern, repeat." Most other things I need a drawing of the circuit, a flowchart or some kind of diagram of what is supposed to happen, maybe a little bit of psuedo code in English of what's supposed to occur for some complex ideas, and convert that to code. Although the majority of the time my coding is just plug and chug test and fix too. 8)
bonxer is offline  
Old 21st November 2004, 09:15 PM   (permalink)
Default well i will get there

your code did work im glad to say but i was very bad and bashed away at the basic and it now works, effectively what i was trying to do was generate a pulse of variable duration between 1 and 5 seconds on port b5 led and show a visable representation of the speed on port b0-b3 led's controled as it turned out not by a pot but by 2 buttons connected to port a0 and port a1. im very proud of this little piece of code as it is my first and as simple as it may be it now has no glitches (i did have some looping issues but ive sorted them now) it is smooth. this is all not to say that im not going to do the assembler, because i am but i just couldnt let this beat me after all it is basic isnt it ,and i can program c to a certain extent in my sleep so this was a matter of pride... (I found a basic compiler that had constructs, structure and syntax close that of 'C' proton was its name. now i will be attempting to learn assembler..thanks for you code by the way i can see what is going on in it which will help a great deal cos all the other stuff i looked at just lost me....
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. ....Asking many questions could make you appear to be a Master! Just Remember Appearances can often be decieving.
Ricardoco is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 03:28 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker