Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:46 26 Nov 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 : Picomite controlling LED matrix sign

     Page 3 of 3    
Author Message
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 11:30am 18 Mar 2024
Copy link to clipboard 
Print this post

Ok, that sounds a much better idea than trying to adjust it in software, which will take up valuable time, i'll see if I can find a TTL OR gate.

Standby for an update...

Tony
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 11:45am 18 Mar 2024
Copy link to clipboard 
Print this post

If you don't have one on hand 2 diodes and a resistor (3.3kΩ should be ok) can make one.
Inputs to the anodes, cathodes and resistor to the output. Other end of resistor to ⏚.
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 11:58am 18 Mar 2024
Copy link to clipboard 
Print this post

Perfect, I found a 74LS32 and did exactly as you said, I now get the correct pattern .
Could I not just have stuck in an extra clock pulse in the shift code with a

pulse  GP2 ,0.1   ' or whatever duration

It doesn't matter, I am only going to make two of these as I have no more matrix panels so the cost of an additional IC is not relevant.

I'll try and buid up dome digits after lunch.

Thank you so much for the help thus far, hopefully by this evening I can get it displaying static digits, then tomorrow I will try and make it count up in 1 second increments before I look at either network time, or parsing a GPS $GPRMC string.

Tony
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4228
Posted: 12:00pm 18 Mar 2024
Copy link to clipboard 
Print this post

  phil99 said  If you don't have one on hand 2 diodes and a resistor (3.3kΩ should be ok) can make one.
Inputs to the anodes, cathodes and resistor to the output. Other end of resistor to ⏚.



Hi Phil,

Both CLK and LE are 3.3V logic signals (pico), driving a 5V CD4094. The diode OR may not achieve Vh levels.


Hi Tony,

When a pin is assigned for SPI, you cannot pulse it with PULSE gpx,time. It gives you an error. That is why the hardware solution was proposed. And it works since the 4094 uses the leading edge of the LE pulse to shift data 1 bit more, and during the rest of the 10us LE pulse this change is immediately latched into the output. When there is a glitch, it is 100ns or so, and your ULN2003's will be to sloow to respond.

Volhout
Edited 2024-03-18 22:05 by Volhout
PicomiteVGA PETSCII ROBOTS
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 12:23pm 18 Mar 2024
Copy link to clipboard 
Print this post

What it looks like so far ..




I have hard coded the 0 and the : in the data lines at the bottom of the code.
I'll make up a table of bit patterns after lunch for each digit 0 - 9 and then look at how I throw those into the array as they change with the count incrementing or the time changing etc.
Super impressed by what we've achieved so far

Thank you all so much

Tony
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4228
Posted: 12:29pm 18 Mar 2024
Copy link to clipboard 
Print this post

       

If you want glitch-free changes of the display

DIM txt_edit(12,6) 'a shadow array.

In the main loop
- use txt_edit() to build up your new led pattern.
- when ready, in main loop, MATH ADD txt_edit(),0,txt_out() to very fast copy txt_edit() to txt_out()

Take care to leave the row pattern in txt_edit() intact during editing (1's character).

Do not touch the interrupt routine "nextrow"anymore. This is debugged, and works.

Regards,

Volhout
Edited 2024-03-18 22:37 by Volhout
PicomiteVGA PETSCII ROBOTS
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 01:31pm 18 Mar 2024
Copy link to clipboard 
Print this post

i've copied the code and saved it in a safe place just in case.....

I worked out the bit patterns for 0 - 9 and Colon

 Zero:
Data 6,9,9,9,9,9,6
One:
Data 4,12,4,4,4,4,14
Two:
Data 14,17,1,6,8,16,31
Three:
data 14,17,1,6,1,17,14
Four:
data 2,16,10,18,31,2,2
Five:
data 31,16,30,1,1,17,14
Six:
data 6,8,16,30,17,17,14
Seven:
data 31,1,2,4,8,8,8
Eight:
data 14,17,17,14,17,17,14
Nine:
data 14,17,17,15,1,2,12
Colon:
Data 0,4,4,0,4,4,0

But looking at the post of yours from earlier, I see how I read the data from the data statements, but I am not sure how to get that into the relevant bit position in the two dimensional array in fast speed.

for example, if the digit is a 5 for the unit seconds,
I would do the read five, each byte would then go into the 9th location in the array (starting from 0) so the first byte of the data statement would go in txt_out(9,1) the second byte in txt_out(9,2) third byte in txt_out(9,3) and so on.


so I could do it like this if the character was five

restore Five:
   for j = 0 to 6
     read txt_out (9,j)
  next


I guess i'm thinking of the time it takes to get the actual time from for example 12:24:30, breaking that into individual digits, then reading each digit from the data statement, and populating the array, is there sufficient time to do all that between display refreshes? plus get in the actual time from NTP or GPS?


Tony
Edited 2024-03-18 23:48 by 58kk90
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4228
Posted: 02:42pm 18 Mar 2024
Copy link to clipboard 
Print this post

Hi Tony,

You fill the txt_edit() array at any slow speed you like. If you have a seconds digit, then you have 1 second to do that. If your fastest digit is minutes, then you have 1 minute to do that. Do not EDIT in txt_out(). See my suggestion 2 posts above.

Simple for i=1 to x loops. Note that you can use variable "i" since the interrupt routine uses a local(static) variable "i". That is completely non-existent outside the interrupt routine.

The only thing that should be fast is replacing the data in the txt_out(). And that is guaranteed by the single instruction MATH ADD txt_edit(),0,txt_out(), essentially copying all data from txt_edit() to txt_out().

Volhout

P.S. you can also look at the MATH INSERT command. In case you have pixel patterns in individual single dimension arrays, you can use this (the opposite for MATH SLICE) to insert a whole character in the txt_edit() array. But you may be more familliar with for i=0 to 6 loops, and there is no critical timing, and no need to do up-front processing.
Edited 2024-03-19 00:55 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4228
Posted: 03:05pm 18 Mar 2024
Copy link to clipboard 
Print this post

Hi Tony,

Example code: assume youhave a text string in format a$="12:23:34".


For i=1 to len(a$)
select case mid$(a$,i,1)
case "1"
  restore one
case "2"
  restore two
 |
etc
 |
case ":"
  restore colon
end select

for j=0 to 6
  read txt_edit(i,j)
next
next

PicomiteVGA PETSCII ROBOTS
 
58kk90
Regular Member

Joined: 14/06/2023
Location: United Kingdom
Posts: 49
Posted: 05:42am 20 Mar 2024
Copy link to clipboard 
Print this post

@Volhout

Sorry for the late reply, again, work got in the way, always happens when you are enjoying something!

I used the internal time$ variable and the bit of code you last posted with a couple of modifications and additions, I now have the hours, mins and seconds counting from 00:00:00 up in 1 second increments, which looks awesome.
There is no flicker at all, so I have taken the time to draw out the schematic of what I currently have and drawn up a PCB for it, the problem is I am doing this on a Pi Pico which doesn't have the WiFi, so I'm at a dead end now as I planned on pulling the time from NTP.

The guy making the PCB is local to me and will do it in 24hrs, so I have also ordered some P-channel SMD mosfets and the other two IC's in SMD packages the entire PCB is in SMD apart from the Pico W and Molex connectors etc.
Hopefully by the weekend it'll all be here and I can build it up and finish it off.

I'll come back and post the final code in case anyone else can make use of it once it's all up and running..

Thank you all so much for helping me get this far, I really never expected it to work as well as it does, just hope I can get the NTP bit running, reading the manual, it looks fairly straightforward.

Tony.
 
     Page 3 of 3    
Print this page


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

© JAQ Software 2024