Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 11:15 05 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM Basic Logic AND command

Author Message
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 04:03pm 17 Mar 2013
Copy link to clipboard 
Print this post

Hi,

I have hooked up a 10 bit i2c device to the MM i2c bus.

The msb and lsb are each read into an array value(2)

dim value(2)
i2crcv address,1,2,value(0),1,0


I print the data to screen as
print value(0), value(1)


For some reason, the value(1) writes values greater than 255 even when ANDed with 255 as in:
Print (value(1) and 255)


Am I missing something?

David M.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 05:15pm 17 Mar 2013
Copy link to clipboard 
Print this post

Hi,

Sorry to trouble anyone - problem solved.

When I cleared the screen and set the Print @(x,y) - i had my coordinates wrong and was left with residual characters from previous read.

Begining to make a habit of these senior moments.


David M.
 
greybeard
Senior Member

Joined: 04/01/2010
Location: Australia
Posts: 158
Posted: 05:42pm 17 Mar 2013
Copy link to clipboard 
Print this post

They can't be that senior if you can remember doing them
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 05:44pm 17 Mar 2013
Copy link to clipboard 
Print this post

That is one of the advantages of being old and forgetful. Every day is a whole new adventure.
VK4MU MicroController Units

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 12:04am 20 Mar 2013
Copy link to clipboard 
Print this post

It's great you were honest enough to say you made a mistake.

Many would not...(not on this forum, but on other forums)Edited by Grogster 2013-03-21
Smoke makes things work. When the smoke gets out, it stops!
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 12:20am 20 Mar 2013
Copy link to clipboard 
Print this post

Dis is not a prefix that goes with honest in my vocabulary.

I know you were not implying otherwise.

If we only reported the things that went right first time, it would be a boring old forum - we all make mistakes and I still laugh at most of mine. Anyway, it makes for a bit of light chit chat and in my world, I need all the levity I can get.
David M.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 12:47am 20 Mar 2013
Copy link to clipboard 
Print this post

"Don't ya love it when it finally works!"

Which device are you using, a 10 bit dac?


Microblocks. Build with logic.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 01:24am 20 Mar 2013
Copy link to clipboard 
Print this post

  TZA said  "Don't ya love it when it finally works!"


Yes, but it would be nice if....

The device is one of my home grown i2c PIC16F88's configured as 7 channel 10 bit A to D. Works quite well with minimal settling time. Certainly good enough for a caravan or solar (etc) monitoring system.

Doesn't look like there is much interest in i2c on this forum?? Can't understand why as I reckon it is far easier to hook up two wires instead of lots of dedicated i/o pins and many devices can be on line at the same time. Oh well...Edited by MOBI 2013-03-21
David M.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 02:29am 20 Mar 2013
Copy link to clipboard 
Print this post

Yes, my favorite interface is plain old serial and I2C as a good second.
Serial mainly because they can be interrupt driven have receive and send buffers etc.
It makes programming so much easier.
I hate bitbanging with a passion. :)
And if bitbanging is really the only way, then let a cheap PIC(AXE) do it and hook it up through serial or I2C.
Even most parallel solutions can easily be done with a PMP port.
I would not mind a PIC32 with only 20 pins but still have 128Kb RAM.



Microblocks. Build with logic.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024