How to tackle a D/S section on a PIC (Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
NOTE: I may not use the correct words!
I use Oshonsoft BASIC and am programming PICs

When looking any section of a D/S the KEYWORDS are in capitals, and the programmer has to sort them out into SYNTAX/CODE. I try to write all of them down and try to join them up as I work though the process, but always have to start again in a different order.

How is this normally done, is this a flow chart.
Camerart
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
No idea what you are talking about. How about an example.

Bob
Hi B,
If you start a PIC project I assume you look at the PIC D/S, then using the information, write the CODE to make the PIC do what you want.
What do you actually do? e,g Write KEYWORD on paper and put them in the logic order/
C
 

BobTPH

Joined Jun 5, 2013
8,967
No, I am unlikely to write anything on paper.

Are you asking how I relate the register names in the datasheet to the predefined symbols in the compiler? If that is the case, I would open the .h file and search for the register name.

Bob
 

John P

Joined Oct 14, 2008
2,026
Camerart, I seem to have a lot of trouble understanding how you're working on your projects.

I don't think many people have problems in the area you're talking about here. You look up a feature of the processor you want to use, you see the names of the registers that are involved, you use those names in your code. The compiler recognizes the names and creates the hex file accordingly.

So (using the Mikroe C compiler) if I want to send a low from bit 4 of Port A, I just do this:
LATA.F4 = 0;

With this processor, it's best to read from the PORTA register and write to the LATA register, but that's all easy to remember. Is it somehow more difficult using BASIC?
 

BobTPH

Joined Jun 5, 2013
8,967
I ask again, can you give us an example, like in the previous post? I am still not sure what you are asking. Maybe it is something specific to the language you are using.

Bob
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi J and B,
I am not good at programming, even though I've done it for years, so my method is try, and when I get stuck ask someone how to get over the problem then move forward.

First, I've been told what I'm trying to do is not viable, so this is only an example!

PIC 18F4431 HW PWM. I read the D/S then try to program.
I soon get stuck with the spaghetti of the D/S in that 'in this case' Maybe 2x timers are used, to start and stop a process, using BITs and PINs that get set when 'say' a timer reaches the value in a register, then the timer needs re-setting to another value, and so on.

So how is all this all planned?

Here' the program I'm trying:
C
 

Attachments

Top