PIC Basic pro

Sep 01, 2009 5 Replies

I have not done much programing in PBP, I mostly have used assembly. I'm trying to knock out a quick program, but one detail is hanging me up. I'm reading a 24C512 EEPROM 8 bytes at a time. I created a word (16bit) variable to hold the memory address.



Problem is when I reach $19F8 the next address should be $0A00, but I get $0000! The low byte works right, then I get to $1B00 and everthing is good until I get to $29F8 and the next address is again $0000! The $0000 addresses are not really $0000, I know this from the data. Every time the high byte reaches $0A it displays $00! I wrote a simple routine to just count from $0000 to $FFF8. It reacts the same! I have PBP ver 2.30, is this a problem with PBP?



My code...



temp: memadd = $0000 Hserout [b1, b0 ] GOTO again again: memadd = memadd + $0008 if memadd = $FFF8 THEN GOTO start ELSE Hserout [b1, b0] ENDIF GOTO again


Isn't there something in the PBP manual about a 2k program space and overcoming that limitation?

There is a whole forum dedicated to answering such questions. I strongly suggest you try there:

formatting link

Cheers Don...

Don McKenzie Site Map: http://www.dontronics.com/sitemap E-Mail Contact Page: http://www.dontronics.com/email Web Camera Page: http://www.dontronics.com/webcam No More Damn Spam: http://www.dontronics.com/spam Breakout, Prototype, Development, & Robotics Boards: http://www.dontronics-shop.com/sparkfun-electronics.html Coupon Specials: http://www.dontronics-shop.com/coupon-specials.html

Compiler bug? Try making $0008 a constant and add the constant.

Cheers

Hi ScadaEng,

I've actually used this chip and Picbasic in a datalogging application. If you can't solve your problem, please let me know and I'll see if I can help.

I just wanted to say: You're moving away from assembly (almost certainly a good decision) to... Picbasic Pro? If you're going to write non-trivial programs, are you sure this is a wise choice?

Before you invest too much effort, please consider:

1) Picbasic doesn't really support modular programming. All variables are global - this really, really sucks. Either you will end up with variables called temp1, temp2, temp5 etc, or at some point you'll cause yourself massive headaches when you accidently reuse a temp variable.

2) Picbasic doesn't support interrupts - the fake interrupts included with PBP don't count. You always have to write your ISR in assembly.

3) Picbasic doesn't properly support strings. Or floating point. Or signed 8 or 16 bit quantities. Or unsigned 32 bit variables.

Point 1) is a big enough issue to look for another compiler IMHO. If you have to stick to PBP, one solution is to write a software stack, to save and preserve certain variables in functions - however you have to be very careful to match every Push with a Pop.

Cheers,

Al

ble

d

is

I've actually used this chip and Picbasic in a datalogging application. If you can't solve your problem, please let me know and I'll see if I can help.

I just wanted to say: You're moving away from assembly (almost certainly a good decision) to... Picbasic Pro?

I agree with your evalulation of PBP. I never used it before this project, and expect I won't bother with it again. A team member bought it, he did not want to learn assembly, or any other language for programing PIC.

Thanks to all who responded!

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required