Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:02 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 : DDS Signal Generator Code

Author Message
SteveA
Regular Member

Joined: 10/03/2017
Location: United Kingdom
Posts: 48
Posted: 01:20am 27 Apr 2017
Copy link to clipboard 
Print this post

I'm trying to get Geoff's code running on a SC Micromite+ LCD Backpack, but I've hit a problem. The following line of code crashes the program:


SetPin Peek(byte Peek(word &H9D000090) + 23), INTL, MyInt


With the message
Error: Pin 3 is reserved at startup


I know the pin numbers are different, so I'll need to make changes, but I don't understand what the above code fragment does.

I can see it sets up an interrupt routine 'Myint' on a high to low pin change, but what do the two peeks and adding 23 do? They look a like pointers to me?

 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 02:03am 27 Apr 2017
Copy link to clipboard 
Print this post


The Peek(byte Peek(word &H9D000090) + 23) is just a sneaky way of reading the interrupt pin assigned to the touch controller when its set up with OPTION TOUCH

so it effectively doing
SETPIN 3,INTL,MyInt

This thread gives details of this PEEK and some others.

Useful MMBasic Peeks


Are you on and MM+ and not an MM ? This would explain the error message.

If so you will need a GUI INTERRUPT command rather than the SETPIN used on the MM
i.e.

GUI INTERRUPT MyInt

Regards
Gerry

Latest F4 Latest H7
 
SteveA
Regular Member

Joined: 10/03/2017
Location: United Kingdom
Posts: 48
Posted: 03:10am 27 Apr 2017
Copy link to clipboard 
Print this post

Ah, excellent. Thank you Gerry - bookmarked!

Yes I'm using the Silicon Chip MM+ lcd packback which uses a MX470.

Replacing the entire line with GUI INTERRUPT MyInt worked a treat.

Regards

Steve

 
Print this page


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

© JAQ Software 2024